Re: [go-nuts] Removing example usage of init() from pkg.Flag docs page?

2022-01-26 Thread Ian Lance Taylor
On Wed, Jan 26, 2022 at 7:46 PM crod...@gmail.com wrote: > > On this page: > > https://pkg.go.dev/flag > > There is an example: > > var flagvar int func init() { flag.IntVar(&flagvar, "flagname", 1234, "help > message for flagname") } > > I understand that this is only an example, but there is no

[go-nuts] Removing example usage of init() from pkg.Flag docs page?

2022-01-26 Thread crod...@gmail.com
On this page: https://pkg.go.dev/flag There is an example: var flagvar int func init() { flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname") } I understand that this is only an example, but there is no real need to use an init() function when using the flag package. When I fi

Re: [go-nuts] Data Structure for String Interning?

2022-01-26 Thread Jesper Louis Andersen
On Sun, Jan 9, 2022 at 11:52 PM jlfo...@berkeley.edu wrote: > > I'm wondering if there's a map-like data structure that would store a > string > as the key, and the address of the key as the value. I'm aware that a > standard > Go map can't be used for this because its components might be moved a

Re: [go-nuts] Go 1.18, generics and fuzz testing

2022-01-26 Thread Ian Lance Taylor
On Wed, Jan 26, 2022 at 4:17 PM Kamil Ziemian wrote: > > I accidentally initialize go.mod files for both tutorial on generics > (https://go.dev/doc/tutorial/generics) and for fuzzing > (https://go.dev/doc/tutorial/fuzz) with command > > go mod init example/nameOfSubject > and as a result both co

[go-nuts] Go 1.18, generics and fuzz testing

2022-01-26 Thread Kamil Ziemian
Hello, I accidentally initialize go.mod files for both tutorial on generics (https://go.dev/doc/tutorial/generics) and for fuzzing (https://go.dev/doc/tutorial/fuzz) with command > go mod init example/nameOfSubject and as a result both contains in respective go.mod file line > go 1.17 In the ca

[go-nuts] Most certificates managed by autocert require manual renewal

2022-01-26 Thread Roland Shoemaker
Hello gophers, The Let’s Encrypt certificate authority is revoking all certificates issued with the TLS-ALPN-01 verification method before 00:48 UTC on 26 January 2022 due to a compliance issue. (Read more in the Let’s Encrypt announcement

[go-nuts] Re: scripting in Go

2022-01-26 Thread eko...@gmail.com
I made a second variant in a separate repo/module: https://pkg.go.dev/github.com/egonk/scr The function names are more descriptive, Printf wrappers were removed and it is not meant to be used as a dot import anymore. On Monday, January 24, 2022 at 12:32:48 PM UTC+1 eko...@gmail.com wrote: > sc

[go-nuts] Re: Anyone else writing an interpreter with Thorsten Ball?

2022-01-26 Thread Kamil Ziemian
I found this books last weeks, on community page of different language and I consider buying them. But I have a lot thing to learn for Go with learning materials for free (unicode, UTF-8, Go spec, etc.), that I will probably postpone this book to the future. If you don't mind, I want to ask you

[go-nuts] Re: G 1.18, remarks on "Tutorial: Getting started with fuzzing (beta content)"

2022-01-26 Thread Kamil Ziemian
Hello, I have few other suggestions about [Tutorial: Getting started with fuzzing](https://go.dev/doc/tutorial/fuzz). In section "Fix the double reverse error", second "Write the code" point three states. > Don’t forget to import the new errors package. The first lines of main.go should look l

[go-nuts] Anyone else writing an interpreter with Thorsten Ball?

2022-01-26 Thread Tim Hardcastle
How's it going? I'd just like to talk with someone who's doing the same thing, it's kind of a lonely hobby. I'm just about to start on the actual interpreter, I've got my lexer and parser working, and I also have a thing called a "relexer" which is kind of an elegant kludge that makes syntactic

[go-nuts] Proposition for Go proverb on generics: Write code, don't design types.

2022-01-26 Thread Kamil Ziemian
"Write code, don't design types." This statement is a title of the section of *Generics!* talk by Robert Griesemer and Ian Lance Taylor at GopherCon 2021, time 21:09 and while I start to try my hands with generics in beta of Go 1.18 I think that it l

[go-nuts] CGO export double-definition

2022-01-26 Thread sh...@tigera.io
Hi, I just got bitten by the problem described in the CGO docs: Using //export in a file places a restriction on the preamble: since it is copied into two different C output files, it must not contain any definitions, only declarations. If a file contains both definitions and declarations, the

[go-nuts] Running golangci-lint run for various different files

2022-01-26 Thread 'Beginner' via golang-nuts
Hey when i run golangci-lint run app/main.go utils/db/db.go i get an error stating `named files must all be in one directory golang` why is that ? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

[go-nuts] Re: G 1.18, remarks on "Tutorial: Getting started with fuzzing (beta content)"

2022-01-26 Thread Kamil Ziemian
Ups, I just push button to send it. Bellow I will continue it. For more experience users it says "The first lines of code should look like this:", when it can just say "Import "fmt" library to use fmt.Printf" or something similar. I hope that I didn't sound to harsh about this tutorial. My Engl

[go-nuts] G 1.18, remarks on "Tutorial: Getting started with fuzzing (beta content)"

2022-01-26 Thread Kamil Ziemian
Hello, I have few doubts about "Tutorial: Getting started with fuzzing (beta content)" (https://go.dev/doc/tutorial/fuzz) and I want to hear your opinions on them. First few disclaimers. I new to fuzzy testing and while I like this idea, I'm to ignorant to say much about it. Also I already r

Re: [go-nuts] fmt.Sscanf strange behaviour

2022-01-26 Thread Brian Candler
On Wednesday, 26 January 2022 at 04:51:04 UTC rol...@gmail.com wrote: > The tool you are looking for is most probably the regex module: > > https://pkg.go.dev/regexp > "Then you have two problems" :-) But it could be reasonable here if the format is fixed. If this is a true multi-valued colum

[go-nuts] Re: scripting in Go

2022-01-26 Thread eko...@gmail.com
Good ideas, I added explanations for the shorthands: https://github.com/egonk/sc/commit/257d48f5ba187082ffb6a9b8b9d326eca26cb787 W or Wrap comes from the classic errors.Wrap (https://github.com/pkg/errors) Long forms might be added in a different package in the future (like github.com/egonk/sc