Re: [go-nuts] Source code : Web Development w Google’s Go

2021-10-09 Thread Ravi Teja
Github repo for Todd's web dev course: https://github.com/GoesToEleven/golang-web-dev On Sat, Oct 9, 2021 at 6:23 PM Akshay Dalvi wrote: > Where i can get source code of following course? > I checked github, but its not same.. > > Udemy - Web Development w Google’s Go (golang) Programming

Re: [go-nuts] goncurses: go get works, but not found by go build

2021-10-09 Thread Kurtis Rader
On Sat, Oct 9, 2021 at 3:23 PM richard thiebaud wrote: > Linux Mint 20.2 go version 1.16 > > I do this: > > dick@dick2:~$ go get github.com/gbin/goncurses > dick@dick2:~$ cd src > dick@dick2:~/src$ go build test.go > test.go:4:2: no required module provides package github.com/gbin/goncurses: >

Re: [go-nuts] How and where the function cmd/go/internal/lockedfile.(*File).Read autogenerated

2021-10-09 Thread Ian Lance Taylor
On Sat, Oct 9, 2021 at 3:23 PM xiaodong liu wrote: > > I debugged the program on linux/loong64 when I rebased code, but I met a bug > that R1 is clobbered, R1 is also as LINK Register on loong64. Here is the > code: > > cmd/go/internal/lockedfile.(*File).Read (b=..., n=, err=...) > at :1 > 1 :

[go-nuts] goncurses: go get works, but not found by go build

2021-10-09 Thread richard thiebaud
Linux Mint 20.2 go version 1.16 I do this: dick@dick2:~$ go get github.com/gbin/goncurses dick@dick2:~$ cd src dick@dick2:~/src$ go build test.go test.go:4:2: no required module provides package github.com/gbin/goncurses: go.mod file not found in current directory or any parent directory; see

[go-nuts] Source code : Web Development w Google’s Go

2021-10-09 Thread Akshay Dalvi
Where i can get source code of following course? I checked github, but its not same.. Udemy - Web Development w Google’s Go (golang) Programming Language -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

[go-nuts] How and where the function cmd/go/internal/lockedfile.(*File).Read autogenerated

2021-10-09 Thread xiaodong liu
Hi, I debugged the program on linux/loong64 when I rebased code, but I met a bug that R1 is clobbered, R1 is also as LINK Register on loong64. Here is the code: cmd/go/internal/lockedfile.(*File).Read (b=..., n=, err=...) at :1 1 : No such file or directory. 7: x/10i $pc => 0x1ca938 : ld.d

Re: [go-nuts] How to automatically embed module name from go.mod into executables?

2021-10-09 Thread Zigster Programmer
Huh. I did not realise that. Thanks very much, Jay. On Sat, Oct 9, 2021 at 3:46 AM Jay Conrod wrote: > Good news! The main package path, the containing module, and all of the > dependencies and their versions are already embedded in Go executables. You > can read that info with `go version -m

[go-nuts] Re: generics: how to repeat type in parameters

2021-10-09 Thread Sathish VJ
Makes sense. Thank you Brian. On Saturday, 9 October 2021 at 23:12:20 UTC+5:30 Brian Candler wrote: > Alternatively, your function can be generic over two different types: > https://go2goplay.golang.org/p/WVVZM-Q_P3t > > In this trivial example though, I still think interface values are what

[go-nuts] Re: generics: how to repeat type in parameters

2021-10-09 Thread Brian Candler
Alternatively, your function can be generic over two different types: https://go2goplay.golang.org/p/WVVZM-Q_P3t In this trivial example though, I still think interface values are what you want. There's not much difference in safety, except you could get passed nil interface values. On

[go-nuts] Re: generics: how to repeat type in parameters

2021-10-09 Thread Brian Candler
"coder" and "tester" are two different defined types, but function Print is defined to take two arguments of the same type. Even though they implement the same interface, they are not the same type. I'd say you want to interfaces *instead* of generics:

[go-nuts] generics: how to repeat type in parameters

2021-10-09 Thread Sathish VJ
How can I repeat the same generics type in the parameters? I'm getting a "does not match inferred type" error for the code below. func Print[T Worker](a T, b T) { fmt.Println(a.Work() + b.Work()) } func main() { c1 := coder{} t1 := tester{} Print(c1, t1) } Compiler

[go-nuts] Re: Should generic parameters act like interface parameters?

2021-10-09 Thread Bryan Boreham
I got an answer at https://github.com/golang/go/issues/48849 - this happens because the compiler uses the same implementation for any type satisfying the constraint. On Sunday, 3 October 2021 at 17:50:34 UTC+1 Bryan Boreham wrote: > I observed that the regexp package has a pool of

[go-nuts] Re: unmarshal xml to a struct edmx:Edmx

2021-10-09 Thread Brian Candler
Sorry, I forgot that you also asked about how to declare the outer element. To do this, you need to add a special "XMLName" pseudo-member to your struct, which is tagged with the outer element name and namespace: https://play.golang.org/p/k4nMBoerzRD Try running this as-is, then commenting

[go-nuts] Re: unmarshal xml to a struct edmx:Edmx

2021-10-09 Thread Brian Candler
Firstly, you can name the struct fields whatever you like, except it needs to start with a capital letter. It doesn't have to match the XML element name at all. Secondly, what you're looking at here is an XML *namespace* declaration. The special attribute

Re: [go-nuts] It looks this is not a goal to make builtin generics be able to be defined/used by the custom generic rules?

2021-10-09 Thread 'Axel Wagner' via golang-nuts
No. It neither was, nor is, a goal. On Sat, Oct 9, 2021 at 8:22 AM tapi...@gmail.com wrote: > > Ian Lance Taylor mentioned that "That is true: that was not a goal": > https://github.com/golang/go/discussions/47330#discussioncomment-1451011 >

Re: [go-nuts] Can generics help me make my library safer?

2021-10-09 Thread roger peppe
On Fri, 8 Oct 2021 at 15:44, mi...@ubo.ro wrote: > I'm using the library with a nosql. I provided the sql example b/c it's > part of the std library. > I like rog's solution(especially on the generic Resource type) but to > reduce friction and make it more idiomatic I would need to be able to >

[go-nuts] It looks this is not a goal to make builtin generics be able to be defined/used by the custom generic rules?

2021-10-09 Thread tapi...@gmail.com
Ian Lance Taylor mentioned that "That is true: that was not a goal": https://github.com/golang/go/discussions/47330#discussioncomment-1451011 Was? Does it mean it is now? -- You received this message because you are subscribed to the