[go-nuts] Re: CGO - http.post returns execption

2018-08-13 Thread nicolas_boiteux via golang-nuts
just opened an issue about that: https://github.com/golang/go/issues/26952 Le dimanche 12 août 2018 23:19:23 UTC+2, nicolas...@yahoo.fr a écrit : > > i don't find any information about this problem :( it doesnt seems to be > relative to c.cstring cause when i use a simple string "hello" instead o

[go-nuts] Re: HTTP/2 Adventure in the Go World

2018-08-13 Thread michal
That's cool, I'm not sure if the locks on Conn object [1] are needed, could it just rely on locking in http2? [1] https://github.com/posener/h2conn/blob/master/conn.go#L18 On Sunday, August 12, 2018 at 4:40:03 PM UTC+2, Eyal wrote: > > Hi, > You are welcome to read a blog post I wrote about a sh

Re: [go-nuts] Is there a way to clear a map similar to slice = slice[:0]?

2018-08-13 Thread roger peppe
I believe this optimisation has been implemented now. Have you tried using Go 1.11 beta (or Go tip) ? See https://tip.golang.org/doc/go1.11#performance-compiler On 12 August 2018 at 11:07, Peter Edge wrote: > With slices, you can do > > slice = slice[:0] > > to remove the values from the slice,

[go-nuts] Re: Examples testing with two newline, but only one newline

2018-08-13 Thread gary . willoughby
Your program doesn't work. On Saturday, 11 August 2018 09:10:04 UTC+1, 子風 wrote: > > Hi > > https://play.golang.org/p/AIB-yJaExVu > > When I want to use examples to test my code, I find something odd. > Example1 could pass, but Example2 failed > > --- FAIL: Example2 (0.00s) >> got: >> hello >> . >

Re: [go-nuts] Is there a way to clear a map similar to slice = slice[:0]?

2018-08-13 Thread Peter Edge
Yes, actually saw that a bit after I sent this email. Thanks for the link though, appreciate it :-) On Mon, Aug 13, 2018 at 11:08 AM roger peppe wrote: > I believe this optimisation has been implemented now. > Have you tried using Go 1.11 beta (or Go tip) ? > See https://tip.golang.org/doc/go1.1

Re: [go-nuts] Re: Examples testing with two newline, but only one newline

2018-08-13 Thread messju mohr
Here is a running version that shows the original poster's problem: On Mon, Aug 13, 2018 at 07:16:08AM -0700, gary.willoug...@victoriaplumb.com wrote: >Your program doesn't work. > >On Saturday, 11 August 2018 09:10:04 UTC+1, 子風 wrote: > > Hi

[go-nuts] liteide x34.1 released, support go1.11 modules

2018-08-13 Thread visualfc
Hi, all. LiteIDE X34.1 released! This version update gocode to support go1.11 modules and vendor by source parser. * LiteIDE Home * LiteIDE Source code * Release downloads * *

Re: [go-nuts] Re: Keep Vendor folder on library Repository is Bad or Good practice.

2018-08-13 Thread Tong Sun
I have no idea what's going on there or the history, but I see https://github.com/jteeuwen/go-bindata is still there, despite that "this repository is not maintained". On Thu, Aug 9, 2018 at 8:58 AM peterGo wrote: > Tong Sun > > "I've never seen [the Author delete the library] happen before." >

Re: [go-nuts] Examples testing with two newline, but only one newline

2018-08-13 Thread Shane
Hmm I meant to reply to the group but I think I inadvertantly replied directly (my apologies). I'll repost my answer because I think that it may help others with the same issue (the multi line examples!) Hi There are two ways to use examples with multi line outputs 1) Multi line comments (Be aw

[go-nuts] Re: Keep Vendor folder on library Repository is Bad or Good practice.

2018-08-13 Thread jfbustarret
IMHO Don't do it for a library. Let your users decide if they prefer to commit their vendor directory or not. Do whatever you want for a standalone project. JFB Le samedi 28 juillet 2018 20:43:04 UTC+2, nafis a écrit : > > Suppose I'm making a library and it does reference some other library n

[go-nuts] [ANN] Squalus, a wrapper for SQL queries

2018-08-13 Thread Olivier Pérès
Hello, Squalus is a small package that makes it easier to perform SQL queries in Go. It is a thin layer that sits on top of the regular Go SQL code and supported drivers (MySQL, SQLite, Postgres) and makes the coder’s life simple, with features such as nam

[go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-13 Thread Stephan Mühlstrasser
Am Sonntag, 12. August 2018 23:30:22 UTC+2 schrieb Dave Cheney: > > This is likely to be issue https://github.com/golang/go/issues/599 > > , https://play.golang.o

[go-nuts] Re: HTTP/2 Adventure in the Go World

2018-08-13 Thread Eyal
Hi Michal, Thanks, When removed, the netconn.TestConn tests are failing for race condition with the -race flag. On Monday, August 13, 2018 at 11:41:23 AM UTC+3, mic...@scylladb.com wrote: > > That's cool, I'm not sure if the locks on Conn object [1] are needed, > could it just rely on locking in

[go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-13 Thread Dave Cheney
No, it’s not a cross compilation issue. Well, yes and no, the rpi is a 32 bit platform so some structures have a different size causing the offset of the field to be 32 but aligned, not the required 64 bit aligned. The play example shows the address of the field is not aligned on a 8 byte boun

[go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-13 Thread Stephan Mühlstrasser
Am Montag, 13. August 2018 22:36:56 UTC+2 schrieb Dave Cheney: > > No, it’s not a cross compilation issue. Well, yes and no, the rpi is a 32 > bit platform so some structures have a different size causing the offset of > the field to be 32 but aligned, not the required 64 bit aligned. > > The p

Re: [go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-13 Thread Philip Chapman
Another option may be to run 32 bit raspberian OS and compile in a virtual machine and compile it there, perhaps. VirtualBox comes to mind. On Mon, Aug 13, 2018 at 1:52 PM, Stephan Mühlstrasser < stephan.muehlstras...@gmail.com> wrote: > > Am Montag, 13. August 2018 22:36:56 UTC+2 schrieb Dave C

[go-nuts] Re: Examples testing with two newline, but only one newline

2018-08-13 Thread jake6502
Looks like a bug to me. I would suggest you open an issue. It is not clear to me what the intended behavior is. It is documented that examples strip some white space when comparing output. So it may be intentional that multiple white space lines are removed from the expected output. In that cas

[go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-13 Thread Dave Cheney
I don’t think that will help. The problem is not cross compilation. The problem is when run in a 32bit environment the offset of that field is not guaranteed to be aligned to 8 bytes. You’ve got a 50/50 chance that each allocation will be properly aligned. -- You received this message because

[go-nuts] Compile to go languages?

2018-08-13 Thread andrewchamberss
Don't get me wrong, I love go, but also wonder if there are any languages that compile to idiomatic go. I noticed reasonml compiles to javascript, and wondered to myself if there is any value in such languages using go as a base for interop to take advantage of the libraries and runtime. Any ex

[go-nuts] `go test -c` skips init from main while `go test` doesn't

2018-08-13 Thread Gert
Hi, `go test` runs the main init but the binary created by go test -c -a -tags 'netgo noplugin' -gcflags "all=-N -l" doesn't. Is this a bug? Also it's seems you can't compile static test binaries only non test binaries can be compiled static? -- You received this message because you are subsc

Re: [go-nuts] liteide x34.1 released, support go1.11 modules

2018-08-13 Thread Space A.
Thank you for your great work! понедельник, 13 августа 2018 г., 18:01:22 UTC+3 пользователь visualfc написал: > > Hi, all. > LiteIDE X34.1 released! > This version update gocode to support go1.11 modules and vendor by source > parser. > > * LiteIDE Home > > * LiteIDE Sourc

Re: [go-nuts] Re: Keep Vendor folder on library Repository is Bad or Good practice.

2018-08-13 Thread Dan Kortschak
It is still there because someone if (hopefully) benificently name squatting there with the same package. It went away and broke things. The person who owns jteeuwen is not Jim (the original owner), and has put back the go-bindata repo to avoid a breakage. It could be far worse. On Mon, 2018-08-13

[go-nuts] Re: Keep Vendor folder on library Repository is Bad or Good practice.

2018-08-13 Thread mart
On Saturday, July 28, 2018 at 11:43:04 AM UTC-7, nafis wrote: > > Suppose I'm making a library and it does reference some other library not > part of the standard library. I want to vendor those so that my library > doesn't fail if the other 3rd party developer deletes their library or > major

[go-nuts] Go 1.11 Release Candidate 1 is released

2018-08-13 Thread Filippo Valsorda
Hello gophers, We have just released go1.11rc1, a release candidate version of Go 1.11. It is cut from release-branch.go1.11 at the revision tagged go1.11rc1. Please try your production load tests and unit tests with the new version. Your help testing these pre-release versions is invaluable. Re

[go-nuts] why my program will panic?

2018-08-13 Thread sheepbao
go version go version go1.10.2 darwin/amd64 test code: func TestPoint(t *testing.T) { type A struct { X int Y string } type B struct { X int Y string Z string } a := A{X: 2, Y: "yy"} b := (*B)(unsafe.Pointer(&a)) b.Z = "zz"

[go-nuts] Re: why my program will panic?

2018-08-13 Thread sheepbao
and I change one line code, than program does not panic. func TestPoint(t *testing.T) { type A struct { X int Y string } type B struct { X int Y string Z string } a := A{X: 2, Y: "yy"} b := (*B)(unsafe.Pointer(&a)) b.Z = "zz"

Re: [go-nuts] why my program will panic?

2018-08-13 Thread Dan Kortschak
Why would you expect this to work? On Mon, 2018-08-13 at 20:44 -0700, sheepbao wrote: > go version > go version go1.10.2 darwin/amd64 > > test code: > > func TestPoint(t *testing.T) { > type A struct { > X int > Y string > } > type B struct { > X int >    

[go-nuts] Re: Compile to go languages?

2018-08-13 Thread Andrey Tcherepanov
There are projects by cznic on github to convert C code to Go in different stages of progress https://github.com/cznic/ccgo https://github.com/cznic/sqlite2go https://github.com/cznic/crt There are some other projects by him (parsing related projects) that you might find interesting. A. On M

[go-nuts] AWS S3 Image Upload with Golang

2018-08-13 Thread maksach
Hi, I am trying to upload a local image file to an AWS S3 bucket and return the public URL in Golang. This is the core Golang code I have written to interact with my S3 bucket: creds := credentials.NewSharedCredentials("/Users/username/.aws/credentials", "default") config := &aws.Con

Re: [go-nuts] why my program will panic?

2018-08-13 Thread sheepbao
I just want to research how golang func stack work. On Tuesday, August 14, 2018 at 12:46:59 PM UTC+8, kortschak wrote: > > Why would you expect this to work? > > On Mon, 2018-08-13 at 20:44 -0700, sheepbao wrote: > > go version > > go version go1.10.2 darwin/amd64 > > > > test code: > > >

[go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-13 Thread Stephan Mühlstrasser
Am Montag, 13. August 2018 23:47:11 UTC+2 schrieb Dave Cheney: > > I don’t think that will help. The problem is not cross compilation. The > problem is when run in a 32bit environment the offset of that field is not > guaranteed to be aligned to 8 bytes. You’ve got a 50/50 chance that each > all

Re: [go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-13 Thread Jakob Borg
It’s a bug in the library if it uses 64 bit atomic operations without ensuring 64 bit alignment. Putting the alignment-required field at the top of the struct is the traditional method. //jb On 14 Aug 2018, at 08:45, Stephan Mühlstrasser mailto:stephan.muehlstras...@gmail.com>> wrote: Am Mont