[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] google code style is the same as gofmt in go codes?

2022-09-13 Thread Moein Halvaei
When I read codes from https://cs.opensource.google/go, indents are 2 spaces and when using gofmt indents are 2 tabs. Why? -- 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

Re: [go-nuts] google code style is the same as gofmt in go codes?

2022-09-13 Thread David Finkel
On Tue, Sep 13, 2022 at 3:55 PM Moein Halvaei wrote: > When I read codes from https://cs.opensource.google/go, indents are 2 > spaces and when using gofmt indents are 2 tabs. Why? > Google's Codesearch defaults to matching Google's C++ style guide rather than Go's recommended style: https://googl

Re: [go-nuts] google code style is the same as gofmt in go codes?

2022-09-13 Thread 'Axel Wagner' via golang-nuts
On Tue, Sep 13, 2022 at 10:46 PM David Finkel wrote: > On Tue, Sep 13, 2022 at 3:55 PM Moein Halvaei > wrote: > >> When I read codes from https://cs.opensource.google/go, indents are 2 >> spaces and when using gofmt indents are 2 tabs. Why? >> > Google's Codesearch defaults to matching Google's

[go-nuts] Is there a better way to write this?

2022-09-13 Thread 'Aaron Spangler' via golang-nuts
I seem to be regularly working with maps of stringsets and I have found myself writing the same pattern over and over and I ended up having my own utility function. More importantly the syntax seems clunky when a key doesn't exist in the map. Is there a better way (go idiomatically way) to write

Re: [go-nuts] google code style is the same as gofmt in go codes?

2022-09-13 Thread David Finkel
On Tue, Sep 13, 2022 at 5:39 PM Axel Wagner wrote: > > > On Tue, Sep 13, 2022 at 10:46 PM David Finkel > wrote: > >> On Tue, Sep 13, 2022 at 3:55 PM Moein Halvaei >> wrote: >> >>> When I read codes from https://cs.opensource.google/go, indents are 2 >>> spaces and when using gofmt indents are 2

Re: [go-nuts] google code style is the same as gofmt in go codes?

2022-09-13 Thread 'Axel Wagner' via golang-nuts
TIL. Do you have an example? FWIW, I can think of a simpler reason why the Config has a Tabwidth field - to use it to decide how many spaces to use for a "tab". Which seems to be at least part of what it's used for . I agree that the use of a TabWriter seems to i

Re: [go-nuts] google code style is the same as gofmt in go codes?

2022-09-13 Thread Dominik Honnef
gofmt's output does not depend on the displayed width of a tab. Indentation uses tabs, alignment within a line uses spaces, and there is no alignment directly following indentation. Note that go/printer allows for configurations other than the one used by go/format / gofmt. It allows indenting wit