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

2024-03-13 Thread Jeffery Carr
On Thu, Mar 7, 2024 at 4:28 AM Jan Mercl <0xj...@gmail.com> wrote: > jnml@e5-1650:~/tmp/get$ GOPATH=$(pwd) GO111MODULE=auto go get -v > modernc.org/sqlite > > jnml@e5-1650:~/tmp/get$ ls pkg/mod/ > cache github.com golang.org modernc.org > Interesting, it does indeed pull the pkg/mod, but in

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

2024-03-13 Thread Jeffery Carr
On Mon, Mar 11, 2024 at 10:05 AM roger peppe wrote: > It's not quite what you're after, but FWIW the gohack command ( > github.com/rogpeppe/gohack) knows enough to download arbitrary Go modules > including the VCS checkout. You might find it useful, I guess. > Okay, yes, I'm only 5 years late to

Re: [go-nuts] debug/gosym.PCToLine breaks on cgo enabled binaries

2024-03-13 Thread Ian Lance Taylor
On Wed, Mar 13, 2024 at 8:04 AM 'Grant Seltzer Richman' via golang-nuts wrote: > > I've been using the `Table.PCToLine` method to resolve program counters > (extracted via bpf) into functions with their file names and line numbers. > > It appears that this breaks when i'm testing it on a binary t

Re: [go-nuts] Why can't I use an interface which needs another interface inside of it

2024-03-13 Thread Mike Schinkel
> On Mar 13, 2024, at 10:27 AM, Brian Hatfield wrote: > > Client.GetChild() must return GetChilder, not Child. Actually, Client.GetChild() must return b.GetDataer, not b.GetChilder, but the example is a mind bender so it was easy to get wrong. I only got it correct by testing the code and fai

Re: [go-nuts] Why can't I use an interface which needs another interface inside of it

2024-03-13 Thread Jason Phillips
Regardless, that's the reason what you've attempted doesn't work. It has its own entry in the Go FAQ: https://go.dev/doc/faq#covariant_types On Wednesday, March 13, 2024 at 1:00:34 PM UTC-4 Rodrigo Araujo wrote: > 'Cause this dependency makes code more "rigid". A refactor in an isolated > pack

[go-nuts] Re: go test -coverpkg=$LIST ... failing with exit code

2024-03-13 Thread Jeremy French
I don't have any insight in trouble-shooting your exact issue, but I too would like a simple, reliable way to exclude packages from -coverpkg=./... Feels like relying on shell scripts (which is what a google search recommends) is a) fragile, and b) not particularly cross-platform. On Tuesday, M

Re: [go-nuts] Why can't I use an interface which needs another interface inside of it

2024-03-13 Thread Rodrigo Araujo
'Cause this dependency makes code more "rigid". A refactor in an isolated package would let to change other packages. Also makes testing more difficult. It is kind of described here: https://go.dev/wiki/CodeReviewComments#interfaces Em qua., 13 de mar. de 2024 às 13:41, burak serdar escreveu: >

Re: [go-nuts] Why can't I use an interface which needs another interface inside of it

2024-03-13 Thread burak serdar
On Wed, Mar 13, 2024 at 10:31 AM Rodrigo Araujo wrote: > > Do you mean b.GetChilder? In this case, package A will depend on package B > and I don't think this is a good approach. Why would it not be a good approach? You have a package declaring interfaces, and if you have another package using t

Re: [go-nuts] Why can't I use an interface which needs another interface inside of it

2024-03-13 Thread Rodrigo Araujo
Do you mean b.GetChilder? In this case, package A will depend on package B and I don't think this is a good approach. Em qua., 13 de mar. de 2024 às 11:28, Brian Hatfield escreveu: > Client.GetChild() must return GetChilder, not Child. > > On Wed, Mar 13, 2024 at 10:02 AM Rodrigo Araujo wrote:

[go-nuts] debug/gosym.PCToLine breaks on cgo enabled binaries

2024-03-13 Thread 'Grant Seltzer Richman' via golang-nuts
I've been using the `Table.PCToLine` method to resolve program counters (extracted via bpf) into functions with their file names and line numbers. It appears that this breaks when i'm testing it on a binary that has cgo enabled. It does not fix it by compiling the binary statically. Another iss

Re: [go-nuts] Why can't I use an interface which needs another interface inside of it

2024-03-13 Thread Brian Hatfield
Client.GetChild() must return GetChilder, not Child. On Wed, Mar 13, 2024 at 10:02 AM Rodrigo Araujo wrote: > Given the code bellow, I'm trying to keep my packages completely > separated, without knowing each other, but the code doesn't work. I just > can get it running when I define (or use) an

[go-nuts] Why can't I use an interface which needs another interface inside of it

2024-03-13 Thread Rodrigo Araujo
Given the code bellow, I'm trying to keep my packages completely separated, without knowing each other, but the code doesn't work. I just can get it running when I define (or use) an interface from one package inside code of the other package. Here is the error: *cannot use client (variable o

Re: [go-nuts] Can't figure out how to create an All() iter.Seq[T] method

2024-03-13 Thread 'Mark' via golang-nuts
Thank you, that solved the problem. On Wednesday, March 13, 2024 at 1:22:06 PM UTC Sebastien Binet wrote: > hi Mark, > > On Wed Mar 13, 2024 at 13:32 CET, 'Mark' via golang-nuts wrote: > > I've been trying to learn how to create an `All() iter.Seq[T]` method > > for a > > simple set type (a map w

Re: [go-nuts] Can't figure out how to create an All() iter.Seq[T] method

2024-03-13 Thread Sebastien Binet
hi Mark, On Wed Mar 13, 2024 at 13:32 CET, 'Mark' via golang-nuts wrote: > I've been trying to learn how to create an `All() iter.Seq[T]` method > for a > simple set type (a map wrapper): > > playground > > It won't work in the playground of course, but

[go-nuts] Can't figure out how to create an All() iter.Seq[T] method

2024-03-13 Thread 'Mark' via golang-nuts
I've been trying to learn how to create an `All() iter.Seq[T]` method for a simple set type (a map wrapper): playground It won't work in the playground of course, but when I do: `GOEXPERIMENT=rangefunc go run .` using Go 1.22 I get this error: ``` cann

[go-nuts] Re: range-over-func has two more alloc than direct-call-func Why?

2024-03-13 Thread 'qiulaidongfeng' via golang-nuts
I got the information ./main_test.go:23:3: func literal escapes to heap: ./main_test.go:23:3: flow: {heap} = &{storage for func literal}: ./main_test.go:23:3: from func literal (spill) at ./main_test.go:23:3 ./main_test.go:23:3: from .autotmp_3(func literal) (call parameter) at ./main_t