Re: [go-nuts] Adding context.Context as first parameter in every function

2024-03-03 Thread 'Yash Bansal' via golang-nuts
@axel Most of the functions I have (except the utility ones) will be needing the context parameter, that's why I thought of adding context to every function, and just using auto-refactoring to remove context from the functions which doesn't use it. @Sam Thanks for providing me with your repo

Re: [go-nuts] GO111MODULE=off go get deprecated?

2024-03-03 Thread Jeffery Carr
Yes, I do understand the go-source/go-import part, but am I missing something? I don't understand how you would find the go-source other than parsing the HTML I mean 'go get' used to do that for me, do I now have to write a program to do that? I don't understand why that is some bad idea.

Re: [go-nuts] GO111MODULE=off go get deprecated?

2024-03-03 Thread Kurtis Rader
On Sun, Mar 3, 2024 at 5:05 PM Jeffery Carr wrote: > "You can build large projects with many repos using Go modules. " > > Also, I forgot to add, lots of my repos are binaries, so module things > don't apply. How do I tell someone to download go.wit.com/apps/helloworld? > I can't now with a

Re: [go-nuts] GO111MODULE=off go get deprecated?

2024-03-03 Thread Jeffery Carr
"You can build large projects with many repos using Go modules. " Also, I forgot to add, lots of my repos are binaries, so module things don't apply. How do I tell someone to download go.wit.com/apps/helloworld? I can't now with a single GO111MODULE=off go get. Can we have 'go download' or can

Re: [go-nuts] GO111MODULE=off go get deprecated?

2024-03-03 Thread Jeffery Carr
I don't think I understand you. How can I download go.uber.org/zap sources? I need to be able to do it using the "go" binary. I was able to do it before, now I can't. Is there some way to do go download go.uber.org/zap and have it git clone? I don't know how to resolve the git clone path.

Re: [go-nuts] GO111MODULE=off go get deprecated?

2024-03-03 Thread 'Christian Stewart' via golang-nuts
Hi Jeffery, You can build large projects with many repos using Go modules. Firstly, you can reference the other repos and use the latest "master" version by writing "master" where the v verson is in the file, then use "go mod tidy" Second, you can use "go work" to create a workspace with

Re: [go-nuts] Enums, Go1 and proposals

2024-03-03 Thread Mike Schinkel
I have recently seen many are complaining about a lack of enums in Go. But while there are many ways in which I would like to see Go improved, enums barely even rank on my list of priorities. The majority of my experience prior to Go was with dynamic languages that did not have explicit

Re: [go-nuts] GO111MODULE=off go get deprecated?

2024-03-03 Thread Jeffery Carr
I guess this boils down to: GO111MODULE=off go get go.uber.org/zap used to git clone into ~/go/src/go.uber.org/zap How am I supposed to do that now? I assume I'm not expected to parse the HTML for the go-import and go-source lines! jcarr -- You received this message because you are

Re: [go-nuts] Data structure code review

2024-03-03 Thread Steven Hartland
Some feedback: Instead of errors.New(emptyDataStructureMessage("stack")) use an emptyDataError type, where it implements the error interface by adding an Error() string method, for example: type emptyDataError string func (e emptyDataError) Error() string { return fmt.Sprintf("not empty %s

Re: [go-nuts] Query Regarding ASAN C Call from Go Code

2024-03-03 Thread Ian Lance Taylor
On Sun, Mar 3, 2024 at 1:25 PM Evgeny Chormonov wrote: > > I noticed that ASAN checker in the Go source code is defined using CGO > https://github.com/golang/go/blob/master/src/runtime/asan/asan.go > But the C ASAN functions are called from the Go runtime using assembly code > instead of a

Re: [go-nuts] GO111MODULE=off go get deprecated?

2024-03-03 Thread Ian Lance Taylor
On Sun, Mar 3, 2024 at 1:25 PM Jeffery Carr wrote: > > Has this been deprecated or maybe it is broken in debian sid, but: > > bash$ GO111MODULE=off go get -v go.wit.com/apps/test > go: modules disabled by GO111MODULE=off; see 'go help modules' > basj$ go version > go version go1.22.0 linux/amd64

[go-nuts] GO111MODULE=off go get deprecated?

2024-03-03 Thread Jeffery Carr
Has this been deprecated or maybe it is broken in debian sid, but: bash$ GO111MODULE=off go get -v go.wit.com/apps/test go: modules disabled by GO111MODULE=off; see 'go help modules' basj$ go version go version go1.22.0 linux/amd64 this doesn't work anymore. Also, 'go help modules' is less than

[go-nuts] Query Regarding ASAN C Call from Go Code

2024-03-03 Thread Evgeny Chormonov
I noticed that ASAN checker in the Go source code is defined using CGO https://github.com/golang/go/blob/master/src/runtime/asan/asan.go But the C ASAN functions are called from the Go runtime using assembly code instead of a common CGO call.

[go-nuts] Data structure code review

2024-03-03 Thread Miss Adorable
Hi! I wrote my first data structure in Go. I wonder how idiomatic my code is to enhance it. Previously, I had C# and Java experience. -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Re: 64 Tiny Algorithmic Puzzles in Go

2024-03-03 Thread BUGFIX 66
Exactly! On Sat, Mar 2, 2024 at 8:37 PM peterGo wrote: > qiulaidongfeng, > > A simpler, solution: > > https://go.dev/play/p/gLY7O_hwyxI > > peter > > On Saturday, March 2, 2024 at 8:25:33 PM UTC-5 qiulaidongfeng wrote: > >> I wrote a correct one, as shown here: >>

[go-nuts] Enums, Go1 and proposals

2024-03-03 Thread Nicolas Serna
Hello, gophers. Lately I've been working quite a bit with enums as I'm moving a C program I had to Go, so I wondered if there was any progress on enums proposals and realized that none of them get anywhere without breaking the Go1 compatibility. I've decided to get a bit creative and share

[go-nuts] Re: c-shared library for Aix

2024-03-03 Thread 'TheDiveO' via golang-nuts
llvm/clang? I've ditched gcc because of its many unfixable problems. After loosing quite some time, trying to cross-compile Go using gcc, I've switched to clang IIRC and this works beautifully, especially cross-building for Alpine/musl. However my AIX time with RS6000 was decades ago, and I