Re: [go-nuts] How to use atomic.Int64?

2022-09-01 Thread 'Keith Randall' via golang-nuts
There's a difference only on platforms that wouldn't normally 8-byte align an int64. Those are the 32-bit platforms, e.g. linux/386. On those platforms your program prints 4 8. On Thursday, September 1, 2022 at 5:15:29 AM UTC-7 axel.wa...@googlemail.com wrote: > I'm not sure under what situati

[go-nuts] Why not judge the status of response in getting module?

2022-09-01 Thread xianzhuo wang
Hi, recently I've been trying to learn the module management.I want to get private module from my own repository. The repository only support HTTP request. I use nginx to proxy to the repository, and nginx listens port 443 and 80. When I try to execute "go get myrepo.com/myrepo", it gives me "40

Re: [go-nuts] How to cross-compile Go 1.19 compiler for Solaris 11 on Linux

2022-09-01 Thread Ian Lance Taylor
On Thu, Sep 1, 2022 at 6:13 AM Shane wrote: > > Does that mean it is not possible to cross-compile Go for a Solaris target on > a Linux host until one or both of those issues have been fixed? You can set the GO_LDSO environment variable to the correct value when running make.bash. That might ha

Re: [go-nuts] How to cross-compile Go 1.19 compiler for Solaris 11 on Linux

2022-09-01 Thread Shane
Does that mean it is not possible to cross-compile Go for a Solaris target on a Linux host until one or both of those issues have been fixed? On Thursday, September 1, 2022 at 4:11:16 AM UTC-4 se...@liao.dev wrote: > That's a known issue, see: > https://go.dev/issue/53813 > https://go.dev/issue/

Re: [go-nuts] How to use atomic.Int64?

2022-09-01 Thread 'Axel Wagner' via golang-nuts
I'm not sure under what situations you get misaligned values. But note that atomic.Int64 has other benefits besides alignment guarantees. Most importantly, it prevents you from accidentally mixing atomic and non-atomic accesses to the same address - every access of an atomic.Int64 is always atomic.

Re: [go-nuts] How to implement LogonUserA function (winbase.h)?

2022-09-01 Thread Marvin Renich
* Chandan Kumar [220901 07:29]: > Hi, > > I am trying to implement a program in which I need the function *LogonUserA > function (winbase.h) *from windows API and this function is not available > in the package *golang.org/x/sys/windows* so any advice would be helpful. First, you need to deter

Re: [go-nuts] Testing custom error type (error type in struct)

2022-09-01 Thread Marvin Renich
* Bagas Sanjaya [220901 06:04]: > > ``` > package tester > > import ( > "testing" > ) > > type Tests struct { > err error > } > > func TestErr (t *testing.T) { > cases := Tests{eTest,} ^ This is at least one of the problems. You must create an instance

[go-nuts] How to implement LogonUserA function (winbase.h)?

2022-09-01 Thread Chandan Kumar
Hi, I am trying to implement a program in which I need the function *LogonUserA function (winbase.h) *from windows API and this function is not available in the package *golang.org/x/sys/windows* so any advice would be helpful. -- You received this message because you are subscribed to the Goo

[go-nuts] Why not judge the status of response in getting module?

2022-09-01 Thread 王先拙
Hi, recently I've been trying to learn the module management.I want to get private module from my own repository. The repository only support HTTP request. I use nginx to proxy to the repository, and nginx listens port 443 and 80. When I try to execute "go get myrepo.com/myrepo", it gives me "40

[go-nuts] How to use atomic.Int64?

2022-09-01 Thread Benz
Since go `1.19`, the [`atomic.Int64`](https://github.com/golang/go/blob/go1.19/src/sync/atomic/type.go#L82) was added ```go type Int64 struct { _ noCopy _ align64 v int64 } ``` There is one additional [`align64`](https://github.com/golang/go/blob/go1.19/src/sync/atomic/type.go#L1

[go-nuts] Re: Testing custom error type (error type in struct)

2022-09-01 Thread yous...@gmail.com
You need to make an instance of eTest: cases := Tests{eTest{},} but that won't work either because your Error func has a pointer reciever - either change that or take the reference: cases := Tests{&eTest{},} On Thursday, September 1, 2022 at 12:04:43 PM UTC+2 bagas...@gmail.com wrote: > Hi, > >

[go-nuts] Testing custom error type (error type in struct)

2022-09-01 Thread Bagas Sanjaya
Hi, I would like check if a dummy function returns the desired error. To do this, I put desired error type on test cases struct (the error field is required in the struct). On test-error.go, I have: ``` package tester import ( "fmt" ) type eTest struct { whatstring } func

Re: [go-nuts] How to cross-compile Go 1.19 compiler for Solaris 11 on Linux

2022-09-01 Thread 'Sean Liao' via golang-nuts
That's a known issue, see: https://go.dev/issue/53813 https://go.dev/issue/54197 - sean On Wed, Aug 31, 2022, 21:35 Shane wrote: > I was finally able to compile the bootstrap on Linux (I had to install the > missing libc). > > However, after copying the .tbz file onto my Solaris 11u4 AMD64 mac