[go-nuts] Re: `go get` and workspaces (`go.work`)

2023-07-13 Thread Jan
Still on the topic, if I have to use `go.mod` replace clauses, what is the point of `go.work` ? Notice replace in `go.work` doesn't work. Any thoughts if it would be appropriate to create an issue to add workspace support for `go get` ? cheers On Wednesday, July 12, 2023 at 12:48:57 AM UTC+2 Ho

[go-nuts] Re: I made a CLI tool, and I'm curious about your ideas

2023-07-13 Thread 'Sandesh Gade' via golang-nuts
Hi, I am curious to know if you've evaluated whether there is any benefit to your tool rather than just running `go mod init projectName`? I don't see any improvements that the `gnt` tool brings to the table other than an unnecessary wrapper/opinionated project layout/structure on top of `go

[go-nuts] SAST tools for Golang

2023-07-13 Thread Ruwanari Heenkenda
What is the best SAST tool to use for Golang code and can be integrated with Goland IDE? -- 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..

[go-nuts] Re: Can a struct be made comparable?

2023-07-13 Thread Brian Candler
Structs are already comparable, but all fields must be the same: https://go.dev/play/p/XwhSz4DEDwL I think your solution with function 'eq' is fine. You can see the same thing in the standard library in slices.CompactFunc and slices.EqualFunc https://pkg.go.dev/slices#CompactFunc https://pkg.go.

[go-nuts] Can a struct be made comparable?

2023-07-13 Thread 'Mark' via golang-nuts
I have a package which has a function `Do[T comparable](a, b []T) Result`. I have a struct: ```go type N struct { x int y int t string } ``` Is it possible to make `N` comparable; in particular by a field of my choice, e.g., `t`? Or will I have to make, say, `DoFunc(a, b []N, eq func(i, j N