[go-nuts] http client GET with err : dial tcp:look up xxxxx: Temporary failure in name resolution

2018-08-28 Thread 'Rick Timmis' via golang-nuts
Hi, try running your code in a debugger, it smells like a DNS resolution failing, leaving your code awaiting a response. In a debugger you would be able to see this happening HTH -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

[go-nuts] Re: sync.(*Map).Load: relocation target sync/atomic.(*Value).Load not defined when building for ios_arm

2018-08-28 Thread Steeve Morin
Actually, the problem happens also without c-archive. I've put out a repro repo at: https://github.com/steeve/rules_go_ios_arm You'll need to run this on macOS (because iOS...). On Monday, August 27, 2018 at 4:37:37 PM UTC+2, Steeve Morin wrote: > > Hey folks, > > I'm trying to build a project

Re: [go-nuts] Re: GoAWK: an AWK interpreter written in Go

2018-08-28 Thread Ben Hoyt
> > Once you have some proper benchmarks, it might be fun to compare GoAWK's > performance to that of my awk package . > Nice -- will do! I don't know how much performance difference this makes in practice, but my > value struct (also in a value.go file) lazily

Re: [go-nuts] Re: Go 1.11 and 1.10.4 are Released

2018-08-28 Thread Michel Casabianca
Hi Gophers, I have updated my list of Go interfaces for these releases : http://sweetohm .net/article/go-interfaces.en.html Enjoy! Le sam. 25 août 2018 à 00:41, Nathan Kerr a écrit : > I updated my release related resources: > >- Go Release Timeline

[go-nuts] Go 1.11 module cache not safe for concurrent use?

2018-08-28 Thread Maxim Khitrov
I'm running into non-deterministic errors when I try to build multiple binaries from the same module with goreleaser in a CI/CD system. Here are some examples: go: finding github.com/pkg/browser v0.0.0-20170505125900-c90ca0c84f15 go: github.com/pkg/browser@v0.0.0-20170505125900-c90ca0c84f15: git

Re: [go-nuts] Regarding string immutablity

2018-08-28 Thread Jan Mercl
On Tue, Aug 28, 2018 at 4:55 PM Jay Sharma wrote: > As I am overwriting the content with new content, Is it inplace replacement [same memory is being updated] or a new copy will be created with new content and old content will be there in the memory ? Basically none of that. Strings indeed are

[go-nuts] Regarding string immutablity

2018-08-28 Thread Jay Sharma
Hi All, I went through documentation and many post. Every where it is specified *strings are immutable*. I have some string : x := "teststring" I want to *wipe out/overwrite* the content of this string x from disk/memory. As per me the simplest way to do this: x = "" or If I want to

[go-nuts] Cross compiling sers (with CGO) to Android

2018-08-28 Thread distributed
I am trying to cross compile the sers library from github.com/distributed/sers to arm64 android. I have an Android SDK on my computer and I point $AR, $CC, $CXX and so on to the relevant programs. In a checkout of the sers library (git clone https://github.com/distributed/sers.git) I run:

[go-nuts] Calling HTML DOM functions with wasm

2018-08-28 Thread Halil Can Kaşkavalcı
I'm trying to create a table. I thought I can call DOM functions with wasm but my attempts so far are not fruitful. Can somebody illustrate how to call, let's say, insertRow() ? -- You received this message because you are subscribed to

[go-nuts] Unexpected behavior of %+02d in Sprintf() and friends

2018-08-28 Thread Eric Raymond
Under Go 1.10.1, feeding an 0 value to a %+02d specifier sometimes yields "+0", not "+00". The attached tiny Go program may reproduce this behavior. I say "may" because I first observed it in a series of unit tests of date format conversions - in different format strings %+02d expanded

[go-nuts] Re: Regarding string immutablity

2018-08-28 Thread jake6502
I think Jan answered the question asked. But, do you have some specific concern that prompted the question? Is it about security, or memory usage, or just curiosity? On Tuesday, August 28, 2018 at 10:55:27 AM UTC-4, Jay Sharma wrote: > > Hi All, > > I went through documentation and many post.

Re: [go-nuts] Re: Regarding string immutablity

2018-08-28 Thread Jan Mercl
On Tue, Aug 28, 2018 at 6:45 PM Jay Sharma wrote: > @Jan, The example you shown it is copying a string to new variable. but my question was related to same variable. > Will it overwrite the same memory or it will create some copy ? The same concept applies as before. String variables are

[go-nuts] gofmt formats different than goimports in go1.11

2018-08-28 Thread Rohit Jain
```err := testService.test.UpdateWithQuery( ctx, bson.M{ -"id": campaignID, +"id": campaignID, "x_yyy.testing": x.y, }, ``` gofmt reports above diff

[go-nuts] Re: Regarding string immutablity

2018-08-28 Thread Jay Sharma
*@Jan*, The example you shown it is copying a string to new variable. but my question was related to same variable. I want to know if I have variable : x := "testsring" Now it overwrite the content of same variable x to some other value: x = "new1string" Will it overwrite the same memory or

Re: [go-nuts] gofmt formats different than goimports in go1.11

2018-08-28 Thread Matthias B.
On Tue, 28 Aug 2018 22:56:24 +0530 Rohit Jain wrote: > > how do I solve this? > Wait for goimports to be updated. Until then, increase the dose of your OCD medication till you stop caring about the difference. MSB -- It was funnier inside my head. -- You received this message because you

[go-nuts] Re: Regarding string immutablity

2018-08-28 Thread Tamás Gulácsi
For security, you should use a []byte and overwrite there, and never create a string out of it (that'd induce a copy). 2018. augusztus 28., kedd 18:45:29 UTC+2 időpontban Jay Sharma a következőt írta: > > *@Jan*, The example you shown it is copying a string to new variable. but > my question

[go-nuts] Re: Regarding string immutablity

2018-08-28 Thread mark
https://github.com/awnumar/memguard is the only project I've noticed that attempts to deal with string security in Go. I haven't used it personally. On Tuesday, August 28, 2018 at 9:45:29 AM UTC-7, Jay Sharma wrote: > > *@Jan*, The example you shown it is copying a string to new variable. but

[go-nuts] Re: Unexpected behavior of %+02d in Sprintf() and friends

2018-08-28 Thread peterGo
Eric, "Width is specified by an optional decimal number immediately preceding the verb. If absent, the width is whatever is necessary to represent the value. " https://golang.org/pkg/fmt/ Width is two. Peter On Tuesday, August 28, 2018 at 12:09:26 PM UTC-4, Eric Raymond wrote: > > Under Go

Re: [go-nuts] astutil.AddImport -- loosing all but the first import

2018-08-28 Thread Todd Neal
n...@mit.edu writes: > As can be seen from my recent posts, I've been playing a lot with the > automatic generation if go programs using go/ast and related packages. > > My current problem is that when I use astutil.AddImport. > > When I rn the program below, which creates a new ast.File and

[go-nuts] Re: Unexpected behavior of %+02d in Sprintf() and friends

2018-08-28 Thread peterGo
Eric, For example, package main import ( "fmt" "runtime" ) func main() { // Correctly prints "+0 00\n" as +00 00 fmt.Printf("%s: %+03d %02d\n", runtime.Version(), 0, 0) } Output: go1.10.3: +00 00 Playground: https://play.golang.org/p/Pt2-YJfQvEo Widths three and two. Peter

[go-nuts] astutil.AddImport -- loosing all but the first import

2018-08-28 Thread naha
As can be seen from my recent posts, I've been playing a lot with the automatic generation if go programs using go/ast and related packages. My current problem is that when I use astutil.AddImport. When I rn the program below, which creates a new ast.File and uses astutil.AddImport to import

[go-nuts] Re: Regarding string immutablity

2018-08-28 Thread peterGo
Jay, A Go string is represented by a struct. type stringStruct struct { str unsafe.Pointer len int } Assigning a new value to a string variable is a struct assignment that does not immediately destroy the underlying value of the original string. Peter On Tuesday, August 28, 2018 at

[go-nuts] Looking for a way to monitor all active Go channels

2018-08-28 Thread Ingo Jaeckel
I am building lots of apps where the consumer/producer pattern plays a big role. Usually, I end up tracking metrics on individual Go channels (e.g. enqueue/dequeue rate, periodically calling len(channel)). This works well to confirm if channels have the right capacity, consumers are keeping up,

[go-nuts] Re: Does fmt.Print* automatically render an error string in as struct (play link)

2018-08-28 Thread mart
You have implemented error on *Thing, so it is *that* which fmt is running, which then in turn runs the implementation from your wrapped error. If you don't wish fmt to treat your *Thing as an error, you must remove method Error() string from it. On Tuesday, August 28, 2018 at 5:15:31 PM

Re: [go-nuts] gofmt formats different than goimports in go1.11

2018-08-28 Thread Ian Lance Taylor
On Tue, Aug 28, 2018 at 10:26 AM, Rohit Jain wrote: > > ```err := testService.test.UpdateWithQuery( > ctx, > bson.M{ > -"id": campaignID, > +"id": campaignID, >

[go-nuts] Does fmt.Print* automatically render an error string in as struct (play link)

2018-08-28 Thread Louki Sumirniy
I discovered quite by accident and now I can't find anything saying as such, but this example package main import ( "fmt" "errors" ) type Thing struct { err error } type thing interface { Error() string } func (t *Thing) Error() string { return t.err.Error() } func main() { t :=

Re: [go-nuts] gofmt formats different than goimports in go1.11

2018-08-28 Thread David Collier-Brown
> > > It was funnier inside my head. > > Sounded grumpy from out here. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[go-nuts] Is the go 1.11 godoc tool 'module-aware'?

2018-08-28 Thread Justin Israel
I've been trying out converting some of our internal projects to go 1.11 using modules instead of glide. We have a build system that provides the ability to generate html docs via "godoc" and I am wondering if godoc has been made "module-aware" in go 1.11? My particular project is using the

[go-nuts] Re: Go 1.11 and 1.10.4 are Released

2018-08-28 Thread Amnon Baron Cohen
Any plans to upgrade https://play.golang.org/ to 1.11? On Friday, 24 August 2018 23:24:25 UTC+1, Andrew Bonventre wrote: > > Hello gophers, > > We just released Go 1.11 and 1.10.4. > > You can read the announcement blog post here: > https://blog.golang.org/go1.1

Re: [go-nuts] astutil.AddImport -- loosing all but the first import

2018-08-28 Thread naha
Thanks Todd. That fixed my problem. Concerning the dummy nodes to want to add to an AST, you could try adding dummy methods to make them to conform to ast.Stmt or whatever? On Tuesday, August 28, 2018 at 6:33:12 PM UTC-4, Todd Neal wrote: > > > > na...@mit.edu writes: > > > As can be seen

Re: [go-nuts] Unexpected behavior of %+02d in Sprintf() and friends

2018-08-28 Thread 'Borman, Paul' via golang-nuts
I believe +0 is correct. That is 2 bytes which is what you requested with %+02d and the + takes up the first byte and 0 fits in the second byte. On Aug 28, 2018, at 10:55 AM, Eric Raymond mailto:e...@thyrsus.com>> wrote: Under Go 1.10.1, feeding an 0 value to a %+02d specifier sometimes

Re: [go-nuts] Re: Regarding string immutablity

2018-08-28 Thread 'Borman, Paul' via golang-nuts
You are only overwriting the pointer to the string (a string is essentially a pointer and a length). If you want to use memory and then zero it out, use a byte slice instead and be careful to not call append where append might allocate new memory. Take a look at

Re: [go-nuts] astutil.AddImport -- loosing all but the first import

2018-08-28 Thread Todd Neal
n...@mit.edu writes: > Thanks Todd. That fixed my problem. > > Concerning the dummy nodes to want to add to an AST, you could try adding > dummy methods to make them to conform to ast.Stmt or whatever? > You can, and you can add them as Expr's or Decl's but then you lose the ability to use

[go-nuts] gocontracts with type invariants

2018-08-28 Thread Marko Ristin
Hi, We implemented a tool to allow design-by-contract in Go by automatically generating pre and postcondition checks in code: https://github.com/Parquery/gocontracts. However, the most interesting part of the design-by-contract, namely invariants, is still missing and I'd like to hear your

Re: [go-nuts] Test caching unexpectedly disabled by -exec

2018-08-28 Thread Steven Hartland
On 24/08/2018 18:00, Ian Lance Taylor wrote: On Fri, Aug 24, 2018 at 8:31 AM, Steven Hartland wrote: Hi all I've just been banging my head why test our linux test env isn't caching tests and found that its down to -exec. The docs (https://golang.org/cmd/go/#hdr-Build_and_test_caching) refer

[go-nuts] Re: How to post Form data using Go WASM?

2018-08-28 Thread comexx
You can check this example: https://github.com/nlepage/golang-wasm/tree/master/examples/long-running On Monday, August 27, 2018 at 4:27:57 PM UTC+2, Tad Vizbaras wrote: > > I am struggling to get this working. > > How to post Form data to the web server using Go WASM? > Do I use fetch API or