Re: [go-nuts] "go-import" is great, we need "go-delete"

2025-01-09 Thread 'Christoph Berger' via golang-nuts
o proxy and its transparency log solve a completely different problem than commit signing. A signed repo can still be rug-pulled under your feet. On 09.01.25 01:17, Jeffery Carr wrote: On Sat, Jan 4, 2025 at 10:54 AM Christoph Berger wrote: > We need "go-delete". Security is

[go-nuts] Re: AI Go code generation and reviewing.

2025-01-04 Thread Christoph Berger
I use Continue, a VSCode extension. I have connected it to Claude (Anthropic) for the chat and Codestral (Mistral) for code completion. I added the Go documentation and the Go standard library documentation as local embeddings. Works well for me. On Saturday, January 4, 2025 at 6:03:44 PM UTC+

Re: [go-nuts] "go-import" is great, we need "go-delete"

2025-01-04 Thread Christoph Berger
> We need "go-delete". Security is not important to us. There should be a balance between people that need security and people that don't need it. Security might not be important to you, but it is important for the clients of your code—for the users that won't expect that a module provider remov

[go-nuts] Re: Iterator handling error

2024-09-03 Thread Christoph Berger
I like this approach. - bufio.Scanner-style errors are a known pattern from the stdlib - The approach keeps the key and value params free for their intended use - It doesn't require nested iter seqs - It is compatible with range loops Made some sample code as PoC -> https://go.dev/pla

[go-nuts] Re: Iterator handling error

2024-08-30 Thread Christoph Berger
Opinionated answer: If a container type cannot iterate over its elements without fail, I would refrain from trying to build a standard iterator for this container type. You'd be shoehorning an iterator that can fail into the iter API that is not designed for dealing with errors. Putting half-w

Re: [go-nuts] How to convert a net.Addr into a netip.AddrPort ?

2023-12-25 Thread christoph...@gmail.com
and client code > > On Dec 24, 2023, at 11:05 AM, christoph...@gmail.com < > christoph...@gmail.com> wrote: > >  > > Hello, > > I'm developping a UDP client server program. Everything is clear on the > server side. > > I'm just a bit confused with t

[go-nuts] How to convert a net.Addr into a netip.AddrPort ?

2023-12-24 Thread christoph...@gmail.com
Hello, I'm developping a UDP client server program. Everything is clear on the server side. I'm just a bit confused with the client side. In C we can specify the network address and set the port to 0 so that a free port is picked. Apparently we can't do that with the net API. The client mu

[go-nuts] Encrypting a small secret using curve25519

2023-09-20 Thread christoph...@gmail.com
Hello, I noticed that the go standard library only support ed25519 signing (https://pkg.go.dev/crypto/ed25519@go1.21.1). I would need to encrypt a small secret with the public key of the receiver so that he is the only one able to decrypt it with its private key. The small secret would typic

[go-nuts] Re: Best IDE for GO ?

2023-08-20 Thread Christoph Berger
*> What I'm looking for is the ability to manage dependencies not only in code, but entirely in a project from requirements to deployment.* I read two different aspects/levels from your question. The first half sounds like you want a graphical/GUI equivalent of go mod for Go dependency managem

Re: [go-nuts] Go Toolchain Management from 1.21.0 onwards

2023-08-16 Thread Christoph Berger
/472> in docker-library/golang also assumes that GOTOOLCHAIN=local preserves pre-1.21 behavior. > On 16. Aug 2023, at 10:42, Stephen Illingworth > wrote: > > On Wednesday, 16 August 2023 at 08:47:36 UTC+1 Christoph Berger wrote: > > Thank you for replying. > > What

[go-nuts] Re: Go Toolchain Management from 1.21.0 onwards

2023-08-16 Thread Christoph Berger
As far as I understand the Toolchains document, Go projects made with Go 1.21 or later can demand a particular toolchain for compiling a module (through the go and toolchain directives). If you disable downloading toolchains as needed, the new behavior of the go and toolchain directives might b

Re: [go-nuts] I need confirmation about whether I'm in front of a linter false positive.

2023-08-15 Thread Christoph Berger
The linter complains because the second err occurs in a different scope. "if err = f(); err != nil" scopes this err instance to the if block. It re-uses the err from the outer scope, which might not be intended. If you only use either of "err = f(); if err..." or "if err = f(); err..." consist

[go-nuts] Re: Any option to substitute plug-in package ?

2023-08-03 Thread Christoph Berger
WebAssembly comes to mind - see, for example, https://wazero.io/ A plugin would then be a .wasm binary that can be compiled in any language that supports WebAssembly as target. Disclaimer: I have not yet tried this approach. On Wednesday, August 2, 2023 at 12:14:15 PM UTC+2 alex-coder wrote: H

Re: [go-nuts] Please consider voting to reopen Golang subreddit

2023-06-27 Thread Christoph Berger
> Personally, I see this as an opportunity to switch to a more > FOSS-friendly alternative: kbin, lemmy, you name it, as long as it > rhymes with fediverse. There is forum.golangbridge.org and maybe more, but the problem is, how to take 200k+ Gophers with you? /r/golang is the largest Go communi

[go-nuts] Interface() method of reflect.Value sometimes allocates, sometimes not

2023-06-26 Thread christoph...@gmail.com
I'm implementing a value encoder similar to gob. While bench-marking my code against gob, I noticed some unexpected memory allocations with a particular type of data. See this minimal code example in the go playground https://go.dev/play/p/4rm-kCtD274 There is a simple function foo() receiving

[go-nuts] Re: delve crashes in presence of a circular reference variable

2023-06-23 Thread christoph...@gmail.com
I should have added that the debugger crashes when it reaches a break point after the p = &p instruction or steps over this instruction. It doesn't crash when there is no break point. Le vendredi 23 juin 2023 à 10:38:32 UTC+2, christoph...@gmail.com a écrit : > Here is the minimal

[go-nuts] delve crashes in presence of a circular reference variable

2023-06-23 Thread christoph...@gmail.com
Here is the minimal example code causing delve 1.20.2 to crash with a stack overflow func TestExample(t *testing.T) { type pptr *pptr var p pptr p = &p t.Error("hello") } Here is the stack trace goroutine 6 [running]: runtime.deductAssistCredit(0x108?) /usr/local/go/src/runtime

[go-nuts] Why is reflect.CanAddr() returning false in this case ?

2023-06-22 Thread christoph...@gmail.com
I'm trying to get the uintptr address of a value p for which I have the reflect.Value so that I can compare it with the value obtained with v.Pointer() when p is a pointer. Here is a simple recursive pointer example code showing what happens: https://go.dev/play/p/pST8DierbXS It is a pointer

[go-nuts] Unexpected circular type definition limitation

2023-06-15 Thread christoph...@gmail.com
It is possible to define two structures globally with mutual type dependency as this: type A struct { B []B } type B struct { A A[] } but I just noticed that we can't do that inside a function: func Foo() { type A struct { B []B } type B struct { A A[]

Re: [go-nuts] Hosting to deploy && run exe ?

2023-06-12 Thread Christoph Berger
Also worth having a look at: - fly.io - encore.dev Fly.io lets you launch apps in micro VMs. Encore.dev is a Go-specific deployment & orchestration framework with a hosting option. Both have a free tier. (Disclaimer: I have no affiliate relationship with any of them.) On Sunday, June 11, 2023 a

[go-nuts] How to detect a reflect.Value of nil ?

2023-06-01 Thread christoph...@gmail.com
I have a method that receives a reflect.Value as input argument. When the method is given the argument reflect.ValueOf(nil), the methods Type(), IsNil(), or IsZero() panic. For instance, when I call the method IsZero() I see the panic message "panic: reflect: call of reflect.Value.IsZero on ze

Re: [go-nuts] Re: Looking Backend Dev Learning Resources

2022-12-05 Thread Christoph Berger
> that would mean the progress made did not invalidate any of effective Go (which seems not possible given the addition of generics) Adding new features makes Effective Go *incomplete* but not *invalid*. There is separate documentation available for Generics and other new features. Go documenta

[go-nuts] Re: Looking Backend Dev Learning Resources

2022-11-30 Thread Christoph Berger
If you know the basics of Go already, Effective Go and the Go FAQ are good starting points for learning what idiomatic Go is like and why certain decisions in the language design were made. On Saturday, November 26, 2022 at 11:37:29 AM U

[go-nuts] Internationalized webpage depending on the user's web browser locale

2022-10-10 Thread Christoph
ith golang 1.19.1; the language of the displayed webpage is English, though my browser locale is German. As far as I found on the internet, the if-else-clause and the .LANG variable come from Go, so I ask here if anyone has an idea of how to make the above work again. Regards Christoph -- Yo

[go-nuts] Re: Go Get Issues

2022-09-27 Thread Christoph Berger
y goroot: > go/src/repository.web.mycompany.com/ then do a git pull > repository.web.mycompany.com/st_nsres.git. From there Go would look for > it there and you wouldn't need to do a go get on it. I am not sure where it > stores it today, if it were possible to somehow c

[go-nuts] Re: Go Get Issues

2022-09-25 Thread Christoph Berger
Hi Rich, I guess, you run into the behavior described here : *> To declare the code location, an import path of the form> * repository.vcs/path *> specifies the given repository, with or without the .vcs suffix, using the named version con

[go-nuts] Go Vulnerability Database: integration into Go toolchain?

2022-09-13 Thread Christoph Berger
Does anybody know if there are plans to integrate vulnerability checks into Go tools like go get, go mod download, or go mod tidy? Right now, devs need to pull vuln information manually, either through running govulnchek or by visiting packages on pkg.go.dev and inspecting the package history

[go-nuts] Re: Is Go 1.19 the last 1.x release?

2022-07-18 Thread Christoph Berger
The talk is from 2017. The version numbers Russ Cox used back then are certainly only examples. As long as all changes and additions to Go are backward-compatible, Go will stay at 1.x. On Saturday, July 16, 2022 at 4:08:26 PM UTC+2 peterGo wrote: > Natasha, > > No. > > Planning Go 1.20 >

Re: [go-nuts] Generic interface compiles with incorrectly instantiated types

2022-06-21 Thread Christoph Berger
> > > On Tue, Jun 21, 2022 at 10:38 AM Christoph Berger > wrote: > >> > The Wrap interface ignores its type parameter >> >> Curious, why doesn't the compiler consider this an error? I would expect >> a "type parameter declared but not used&quo

Re: [go-nuts] Generic interface compiles with incorrectly instantiated types

2022-06-21 Thread Christoph Berger
> The Wrap interface ignores its type parameter Curious, why doesn't the compiler consider this an error? I would expect a "type parameter declared but not used" error, similar to the "variable declared but not used" error. Or are there valid use cases for types that declare a type parameter bu

[go-nuts] Re: Installing a package with an associated command

2022-05-25 Thread christoph...@gmail.com
> On Wednesday, 25 May 2022 at 08:13:58 UTC+2 christoph...@gmail.com wrote: > >> I have a small package (https://github.com/chmike/clog) that also >> contains a command in the cmd subdirectory (clogClr). How do I install >> the clog package and the command ? >> >

[go-nuts] Installing a package with an associated command

2022-05-24 Thread christoph...@gmail.com
I have a small package (https://github.com/chmike/clog) that also contains a command in the cmd subdirectory (clogClr). How do I install the clog package and the command ? When I execute "go install github.com/chmike/clog@latest" I get the error message that it is not a main package. When I us

Re: [go-nuts] Re: Can’t view golang source when clicking on method name in a pkg.go.dev

2022-04-26 Thread christoph...@gmail.com
Thank you very much. I disabled the DuckDuckGo Privacy Essentials extension and it now works. I also noticed that when I do a duckduckgo search for golang packages, that the pkg.go.dev pages are low ranked if present. I'l

[go-nuts] Re: Can’t view golang source when clicking on method name in a pkg.go.dev

2022-04-26 Thread christoph...@gmail.com
This is a screen capture of what I see https://imgur.com/a/nuBfZeY Le mardi 26 avril 2022 à 09:37:38 UTC+2, christoph...@gmail.com a écrit : > Sorry, my message needs a clarification. The page > https://cs.opensource.google/go/go/+/go1.18.1:src/encoding/json/stream.go;l=49 > > doe

[go-nuts] Re: Can’t view golang source when clicking on method name in a pkg.go.dev

2022-04-26 Thread christoph...@gmail.com
se. Le mardi 26 avril 2022 à 09:16:06 UTC+2, christoph...@gmail.com a écrit : > I’m redirected to this page > https://cs.opensource.google/go/go/+/go1.18.1:src/encoding/json/stream.go;l=49 > > when I click on the Decode method in the web page > https://pkg.go.dev/encoding/jso

[go-nuts] Can’t view golang source when clicking on method name in a pkg.go.dev

2022-04-26 Thread christoph...@gmail.com
I’m redirected to this page https://cs.opensource.google/go/go/+/go1.18.1:src/encoding/json/stream.go;l=49 when I click on the Decode method in the web page https://pkg.go.dev/encoding/json#Decoder. Is this a transient problem or is the code not open source anymore ? -- You received this me

[go-nuts] How to format hour in 24h format without leading 0 ?

2022-04-25 Thread christoph...@gmail.com
I need to format a time stamp hours in 24h format but without leading 0. This means 7 -> "7" and 17 -> "17". For 24h values, the only formatting key value provided and documented is 15. But this produces "7" -> "07" and 17 -> "17" which is not what I need. According to https://gosamples.dev/da

[go-nuts] Re: When will the official encoding/json package support parsing json5?

2022-03-20 Thread christoph...@gmail.com
You might want to try qjson that I wrote a year ago (https://github.com/qjson). It's basically just one function that converts qjson text into json. Qjson is inspired by hjson, but extend it in many ways. It is convenient for config files. Maybe I extend it a bit too far by supporting unquote

Re: [go-nuts] Possible float64 precision problem

2022-03-10 Thread christoph...@gmail.com
> debugging/reverse engineering and I think it will be a good exercise. > > Thank you! > > Best > > Pablo > > On Wed, Mar 9, 2022, 4:39 PM 'Dan Kortschak' via golang-nuts < > golan...@googlegroups.com> wrote: > >> On Wed, 2022-03-09 at 03:37

[go-nuts] Re: Possible float64 precision problem

2022-03-09 Thread christoph...@gmail.com
A simple C and Go program to demonstrate the problem doesn't show any difference between C and Go. It's thus most probably a difference in the code that I must investigate. Sorry for the noise. Le mercredi 9 mars 2022 à 12:37:10 UTC+1, christoph...@gmail.com a écrit : > I&#x

[go-nuts] Possible float64 precision problem

2022-03-09 Thread christoph...@gmail.com
I'm translating a scientific C program into Go that is doing some 64bit floating point operations. In this process I check that the same input yields the same output. Unfortunately they don't yield the same result, though the computation is simple. It is as follow. I receive a 64bit integer va

[go-nuts] Re: go log.Println(http.ListenAndServe(...)) blocks

2022-02-18 Thread Christoph Berger
locks. > Only the log.Println call would run in the newly started goroutine. > > On Friday, February 18, 2022 at 5:35:52 PM UTC+1 christoph...@gmail.com > wrote: > >> Hi gophers, >> >> I hope someone can help finding out why a particular goroutine call can >>

[go-nuts] go log.Println(http.ListenAndServe(...)) blocks

2022-02-18 Thread Christoph Berger
Hi gophers, I hope someone can help finding out why a particular goroutine call can block the main goroutine. In the following code, all "go" calls spawn off a goroutine and return as expected, except for the last one that blocks the main goroutine. Is this a bug, or am I missing something s

[go-nuts] New edition of the Go Programming Language comming soon ?

2022-02-13 Thread christoph...@gmail.com
Hello Go friends, is there a new edition of the "Go Programming Language" book to be published soon ? It is quite old now and there have been a few changes to Go since then. Go.mod and generics. I was considering buying it, but if a new edition comes out in a few months, it would be wasted mo

[go-nuts] Re: scripting in Go

2022-01-27 Thread Christoph Berger
Thanks for adding a long-name variant! Indeed I feel the code is much more self-documenting this way. But in the end it is only a matter of getting used to an API. Power users of "sc" will certainly be able to read the original short-name variant without problems. On Thursday, January 27, 2022

[go-nuts] Re: scripting in Go

2022-01-25 Thread Christoph Berger
Thanks for sharing your package. To me it seems that the functions are rather shallow wrappers around other single functions from the standard library (e.g., sc.P() maps 1:1 to fmt.Printf()). You certainly save a couple of keystrokes while *writing* a script this way, but on the other hand, *re

[go-nuts] Re: Unable to handle duplicate cookies

2021-09-23 Thread christoph...@gmail.com
uld > be pretty easy > > On Thursday, September 23, 2021 at 10:02:34 AM UTC+2 > christoph...@gmail.com wrote: > >> I implemented a simple web site with a csrf secure cookie that is reset >> for each page showing a form. I assumed that simply setting the cookie with &g

[go-nuts] Unable to handle duplicate cookies

2021-09-23 Thread christoph...@gmail.com
I implemented a simple web site with a csrf secure cookie that is reset for each page showing a form. I assumed that simply setting the cookie with the same name and a new value would override the cookie in the client browser. This assumption is correct as long as the url of the page is the sam

[go-nuts] Re: [ANN] Scriggo - Go template engine and embeddable interpreter

2021-09-16 Thread Christoph Berger
Hi Marco, That's super interesting, especially the Go interpreter part. Curious – how close is the interpreter to the latest Go version? And how fast are new Go versions adopted? Thanks, Christoph On Wednesday, September 15, 2021 at 3:15:43 PM UTC+2 Marco Gazerro wrote: > Announcing

[go-nuts] derive encoder/decoder from std json encoder/decoder ?

2021-07-08 Thread christoph...@gmail.com
I need to write a binary encoder/decoder very similar to the std JSON encoder/decoder. I would like to reuse 80% of the JSON encoder/decoder code and adapt it to support my binary encoding. Is this allowed and at which condition ? Would it be possible to publish my code on github with an MIT

Re: [go-nuts] Computing a hash over a uintptr ?

2021-06-04 Thread christoph...@gmail.com
ts < > golan...@googlegroups.com> wrote: > > > >  > > On Thu, Jun 3, 2021 at 4:19 PM christoph...@gmail.com < > christoph...@gmail.com> wrote: > >> > >> The documentation doesn’t specify that we can cast an uintptr into a > uint64. > >

[go-nuts] Computing a hash over a uintptr ?

2021-06-03 Thread christoph...@gmail.com
The documentation specifies that a pointer can be cast into a uintptr integer. I assume that the uintptr is ignored by the garbage collector. I would like to compute a hash over the uintptr. How do I achieve that ? The documentation doesn’t specify that we can cast an uintptr into a uint64. T

[go-nuts] Security issue in

2021-05-07 Thread christoph...@gmail.com
I just became aware of a security problem in the package https://github.com/satori/go.uuid through this reddit thread : https://www.reddit.com/r/golang/comments/n6bnsh/cve20213538_issued_for_latest_release_of/?utm_source=share&utm_medium=ios_app&utm_name=iossmf The is

[go-nuts] Re: How to manage replace directives in go.mod files when code versioning ?

2021-04-26 Thread christoph...@gmail.com
in other modules. See Minimal > version selection <https://golang.org/ref/mod#minimal-version-selection> for > details."? > > You can find it here: https://golang.org/ref/mod#go-mod-file-replace > > On Tuesday, April 27, 2021 at 7:23:52 AM UTC+2 christoph...@gmail.co

Re: [go-nuts] rationale for math.Max(1, math.NaN()) => math.NaN()?

2021-04-26 Thread christoph...@gmail.com
It seam that C is wrong on this one and Go is right. The rationale is that a NaN must propagate through operations so that we can detect problems (avoid silent NaNs). See https://en.wikipedia.org/wiki/NaN Thus any operation involving a NaN must return an NaN and this includes Max and Min. Le

[go-nuts] How to manage replace directives in go.mod files when code versioning ?

2021-04-26 Thread christoph...@gmail.com
When debugging or testing we may need to add a replace directive in the go.mod file. This change intended to be local only may interfere with code versioning. The replace directive may be accidentally committed and published. What is the proper way to manage replace directives when it comes to

[go-nuts] Big variations in benchmarking results ?

2021-04-07 Thread christoph...@gmail.com
Hello, I'm benchmarking some code with my mac book air. The code is only computation and writing in a preallocated slice. I see big variations in the ns/op (e.g. 5000 to 8000). I disabled the turbo boost but the variations are still there. To verify I tried the code benchmarking on an Ubuntu

[go-nuts] Is the Go png encoder performing gamma correction ?

2021-03-30 Thread christoph...@gmail.com
It is unspecified in the documentation if the png encoder is performing gamma correction. I thus assume that it is not performing gamma correction. Is this assumption correct ? According to wikipedia, jpg images are gamma encoded. What is the status of png images ? It seam relevant for antiali

Re: [go-nuts] Casting int to bool and the reverse for bit hacking ?

2020-11-22 Thread christoph...@gmail.com
368G > > I don't see branching in relevant parts. v == v1 || v == v2 will of > course branch because || is a condition. > > Does that answer your question or maybe I am missing something? > > пт, 20 нояб. 2020 г. в 11:27, christoph...@gmail.com > : > > > > Go ha

[go-nuts] Re: Carting int to bool and the reverse for bit hacking ?

2020-11-21 Thread christoph...@gmail.com
Thank you for the responses. Unfortunately, they all comment on the given use case. The real question is if we should add a function in math/bits that performs the operation. The function would be func notZero(x int) int { if x == 0 { return 0 } return 1 } Regarding code

[go-nuts] Carting int to bool and the reverse for bit hacking ?

2020-11-20 Thread christoph...@gmail.com
Go has a strict type separation between int and bool. For a normal usage this is OK. I guess it also ease assembly portability because there is not always a machine instruction to do so. For bit hacking, this is an unfortunate limitation. A handy feature of bool <-> int conversion is that true

[go-nuts] Re: Why key.PublicKey.Equal(key.PublicKey) return false ?

2020-10-27 Thread christoph...@gmail.com
My formulation was not clear. The test fails, and it reports a key mismatch. Le mardi 27 octobre 2020 à 16:21:05 UTC+1, christoph...@gmail.com a écrit : > I have the following test that fails reporting a key mismatch. > > func TestKeyEqual(t *testing.T) { > key, err := rsa

[go-nuts] Why key.PublicKey.Equal(key.PublicKey) return false ?

2020-10-27 Thread christoph...@gmail.com
I have the following test that fails reporting a key mismatch. func TestKeyEqual(t *testing.T) { key, err := rsa.GenerateKey(rand.Reader, 2048) if err != nil { t.Fatal("failed generating private key: ", err) } if !key.PublicKey.Equal(key.PublicKey) { t.Fatal

[go-nuts] Re: my package not include in go modules

2020-07-28 Thread Christoph Berger
the usual convention that one repo = one module." – Christoph On Saturday, July 25, 2020 at 7:03:44 AM UTC+2 alideve...@gmail.com wrote: > I want to import libraries in module file but modules add all other > libraries except those packages which I had created, DB is one of them. How > t

[go-nuts] Re: Generics and parentheses

2020-07-20 Thread christoph...@gmail.com
I would like to insist on considering the D syntax using the ! for generics instantiation. The first time I saw it, I was puzzled and found it unpleasant. But this is just because it is unfamiliar and not intuitive. Once I got used to it, I found it much simple than the C++ templates. In fact

Re: [go-nuts] Should an assignment from int to a type based on int succeed?

2020-05-08 Thread Christoph Berger
y string if we resolve the error ambiguity > or could be "except error"). That way, if someone uses a "defined type" link > to see what it means (as Christoph did here for assignability) they'll get an > immediate answer about the implications. This. I agree

Re: [go-nuts] Should an assignment from int to a type based on int succeed?

2020-05-08 Thread Christoph Berger
t still... On 8. May 2020, 16:42 +0200, Jan Mercl <0xj...@gmail.com>, wrote: > On Fri, May 8, 2020 at 4:31 PM Christoph Berger > wrote: > > > Unfortunately, the connection between "predeclared" (or "implicitly > > declared" as the first paragraph says) a

Re: [go-nuts] Should an assignment from int to a type based on int succeed?

2020-05-08 Thread Christoph Berger
d it.) On 8. May 2020, 16:01 +0200, Jan Mercl <0xj...@gmail.com>, wrote: > On Fri, May 8, 2020 at 3:29 PM Christoph Berger > wrote: > > > So I conclude that the assignment of *int to intp succeeds because *int is > > not a defined type and both *int and intp have the s

Re: [go-nuts] Should an assignment from int to a type based on int succeed?

2020-05-08 Thread Christoph Berger
Thanks for the quick reply Jan. So I conclude that the assignment of *int to intp succeeds because *int is not a defined type and both *int and intp have the same underlying type *int. Looking through the ref spec I found a couple of places that mention some defined types (esp., all numeric typ

[go-nuts] Re: Go policy does not fully support previous release

2019-10-01 Thread Christoph Berger
A question based on genuine interest: Which factors make it hard for you to upgrade to the latest Go release? On Monday, September 30, 2019 at 9:49:39 PM UTC+2, Liam wrote: > > I was startled to learn that regressions found in the previous release > (currently 1.12.x) will not be fixed in that

Re: [go-nuts] Re: concurrency programing about go

2017-11-06 Thread Christoph Berger
Always call Add() before spawning the corresponding goroutine(s). And always call Add() in the same goroutine that also calls Wait(). This way you have no race condition between Add(), Done(), and Wait(). On Saturday, November 4, 2017 at 10:46:21 AM UTC+1, Henrik Johansson wrote: > > I find con

Re: [go-nuts] Rationale in docs on why you need to use the result of append()

2017-11-06 Thread Christoph Berger
This describes pretty clearly what happens behind the scenes. Still, someone could wonder why append then does not receive a pointer to the slice, to ensure that both the slice header and the slice data are treated in a consistent way. What is the generally accepted answer to this? For exampl

[go-nuts] Re: How to learn golang web development

2017-10-15 Thread Christoph Berger
"Learn to Create Web Applications using Go" offers both a course and a book about the topic. I have the book and love it, and the course also looks impressive from what I can see on the landing page. On Thursday, October 12, 2017 at 3:39:32 PM UTC+2, snakes wrote: >

[go-nuts] Re: ListenAndServeTLS() godoc comment

2017-09-19 Thread Christoph Berger
September 19, 2017 at 11:43:49 AM UTC+2, Christoph Berger > wrote: >> >> My fault, I misinterpreted the diagram on Wikipedia. You are right, the >> root CA would not have to be sent to the client then. >> >> When I visit the source of ListenAndServeTLS and drill

[go-nuts] Re: ListenAndServeTLS() godoc comment

2017-09-19 Thread Christoph Berger
rtificate-Chains-and-Transvalid-Certificates.html > > ("a common issues is that people unneccesarily[sic] send the root > certificate, which doesn't cause issues but may make things slower") > > BTW: The Baseline Requirements do not allow that a server certificate

[go-nuts] Re: ListenAndServerTLS() godoc comment

2017-09-18 Thread Christoph Berger
I am no TLS expert, but your question makes me wonder why the server should *not* serve the root CA's certificate. After all, it contains the signature that validates the server's certificate (either directly of

Re: [go-nuts] Offline Go Documentation Tools

2017-08-10 Thread Christoph Berger
> > Is Visual Studio Code a .Net app that takes up lots of memory and CPU? > Worse, it's an Electron app :) I use VSC on an old 2012 Mac Mini, and I cannot confirm that it consumes lots of CPU or memory, even with about two dozen extension installed. It is fast and responsive (some say it is not

Re: [go-nuts] "find" for Slices like "append"

2017-08-08 Thread Christoph Berger
May I ask why you turned to Go in the first place? Your taunting remarks seem to indicate that you were forced moving to Go; but on the other hand, earlier you indicated that you need to sell Go (or rather, the lack of a feature in Go) to your team, so it seems you are the driving force behind

Re: [go-nuts] Reasoning behind behavior of range, when index is maintained

2017-08-02 Thread Christoph Berger
y 27, 2017 at 2:21:34 PM UTC+2, Christoph Berger wrote: > That’s actually what I meant to indicate in the last paragraph (emphasis > added by me): > > > The code in the Reddit post takes advantage of the fact that the last > > increment of the C-style loop can be observe

Re: [go-nuts] Reasoning behind behavior of range, when index is maintained

2017-07-27 Thread Christoph Berger
t been clear to everyone. > On Wed, Jul 26, 2017 at 08:44:46AM -0700, Christoph Berger wrote: > >>> someone shared [this question]( >>> https://www.reddit.com/r/golang/comments/6paqc0/bug_that_caught_me_with_range/) >>> >>> on reddit. I must say, th

[go-nuts] Re: Reasoning behind behavior of range, when index is maintained

2017-07-26 Thread Christoph Berger
Hi Axel, An attempt to explain this by looking at the C-style loop only: The classic C-style for loop for i:=0; i > Hey, > > someone shared [this question]( > https://www.reddit.com/r/golang/comments/6paqc0/bug_that_caught_me_with_range/) > > on reddit. I must say, that I'm surprised by the be

Re: [go-nuts] How to manage multiple versions of Go?

2017-06-25 Thread Christoph Berger
7, Jesper Louis Andersen > wrote: > > On Sun, Jun 25, 2017 at 4:36 PM Christoph Berger > mailto:christoph.g.ber...@gmail.com>> wrote: > Thanks to the Go 1 Compatibility Promise, it was never a problem for me to > always use the latest Go version (via Homebrew, BTW, which keep

Re: [go-nuts] How to manage multiple versions of Go?

2017-06-25 Thread Christoph Berger
Thanks! > > > > On Sunday, June 25, 2017 at 7:36:20 AM UTC-7, Christoph Berger wrote: > Thanks to the Go 1 Compatibility Promise, it was never a problem for me to > always use the latest Go version (via Homebrew, BTW, which keeps my Go > installation up-to-date with next-to-

[go-nuts] Re: How to manage multiple versions of Go?

2017-06-25 Thread Christoph Berger
Thanks to the Go 1 Compatibility Promise, it was never a problem for me to always use the latest Go version (via Homebrew, BTW, which keeps my Go installation up-to-date with next-to-zero effort). If I ever have the need to use an older version, I'd probably use Docker for that. Advantages o

[go-nuts] Re: Is it ok to separate Open and Close logic?

2017-05-15 Thread Christoph Berger
Is there any reason that Cleanup(f) should be called within DoingStuff()? (A reason that maybe is not visible in your example but might become obvious in a more complex scenario?) Otherwise you could just call `defer Cleanup(file)` in DoStuff() with exactly the same result, and you are back at

Re: [go-nuts] Re: Should a program always exit in main()?

2017-02-08 Thread Christoph Berger
Well, I already thought that my suggestion seems somewhat too simple… :) I agree, if a fatal error occurs within a goroutine but you don’t want to crash the whole process from within this goroutine (or even from within the library), then error channels seem the way to go. > Am 08.02.2017 um 11:

[go-nuts] Re: Should a program always exit in main()?

2017-02-08 Thread Christoph Berger
To me, the simplest way seems to be to just return an error to the caller outside the library: func (c *Client) Start() *error* { for { select { case m := <-c.message: for _, handler := range c.handlers { err := handler(m) *if err != nil {* *return err* * }* } } } } On Wednesday, Februa

[go-nuts] using signed urls with cloud.google.com/go/storage

2017-01-26 Thread Christoph Hack
requests using a session id obtained by the Post request). But i would prefer to reuse the upload logic and proper error handling of the "cloud.google.com/go/storage" package (as well as the nice API). A short example or hint would be highly appreciated. Many thanks, Christoph -- You rec

Re: [go-nuts] Re: Disadvantage of Go

2017-01-14 Thread Christoph Berger
ave harder time > working around the lack of generics in Go because they are used to that > feature to solve their problems. > > To the latter I'd say that if Go feels tedious for a task then use something > else, really. Go wasn't designed to please people who l

[go-nuts] Re: Disadvantage of Go

2017-01-14 Thread Christoph Berger
ement that!", then you might become blind for other solutions. Some time ago I collected a number of alternatives to using generics - see: https://appliedgo.net/generics Best, Christoph On Saturday, January 14, 2017 at 7:42:43 AM UTC+1, Yu Liu wrote: > > Agree. > > On

[go-nuts] Deleting the /r/golang subreddit

2016-11-24 Thread Christoph Berger
Deleting /r/golang means destroying a very active community. Deleting /r/golang means deleting years of helpful answers, fruitful discussions, and useful links. Deleting /r/golang means thousands of seach engine results becoming stale. Deleting /r/golang means making Go less visible to the world.

Re: [go-nuts] Re: Namespacing hack using method on empty type

2016-08-05 Thread Christoph Berger
all, packages are the natural means for creating a namespace. Thx > Am 05.08.2016 um 11:10 schrieb Christian Joergensen > : > > Hi, > > For starters, packages can't implement interfaces. > > Cheers, > > On Friday, August 5, 2016 at 6:19:31 AM UTC+2, Chri

[go-nuts] Re: Namespacing hack using method on empty type

2016-08-04 Thread Christoph Berger
Are there any advantages over using real packages? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, vis

[go-nuts] Re: how is log.Panic useful?

2016-07-24 Thread Christoph Seufert
In startup situation when you like to grab the extra information about all the goroutines that might already have been started. Those are situations where i regularly panic, because i somethings goes wrong there i want to grab all the possible information i can. On Monday, July 25, 2016 at 2:42

[go-nuts] Re: OS X Installer: Why modify $PATH instead of adding symbolic links to /usr/local/bin?

2016-07-14 Thread Christoph Berger
I cannot answer your question; I just wanted to mention that homebrew creates symlinks in /usr/local/bin when installing Go. So if you are just looking for an installer that does not extend $PATH, you might want to give homebrew a try. On Tuesday, July 12, 2016 at 10:05:36 PM

Re: [go-nuts] function with goroutine returned will kill its goroutine?

2016-07-06 Thread Christoph Berger
m abnormally terminates), lest someone > complain that their defer functions were not run. > > On Tue, Jul 5, 2016 at 12:29 PM, Christoph Berger > mailto:christoph.g.ber...@gmail.com>> wrote: > In addition to that, all goroutines exit when the main function exits. In > your

Re: [go-nuts] function with goroutine returned will kill its goroutine?

2016-07-05 Thread Christoph Berger
In addition to that, all goroutines exit when the main function exits. In your code, this happens when i == 5. This explains the output that you get. Both goroutines are able to produce five numbers until the main loop finishes and the main function exits. On Monday, July 4, 2016 at 5:13:39 PM

[go-nuts] Re: Currying in Go

2016-06-19 Thread Christoph Berger
> this seems like an eyesore and maintenance concern. (...) it does cause me to hear code review sirens going off in the distance. Then why would you want to use currying in Go at all? What's the point of being able to write f(1)(2)(3) instead of f(1,2,3) *in a non-functional language?* Especi