Re: [go-nuts] Vendored trace package causes panic because of implicit handlers

2016-07-06 Thread Peter Bourgon
On Tue, Jul 5, 2016 at 9:19 PM, Sam Whited wrote: > On Tue, Jul 5, 2016 at 1:52 PM, Peter Bourgon wrote: >> Since you removed the vendor/ directory from jitsi/jap, everything is >> working as expected, right? > > Yes, but the vendor dir was in the application code, not the library > (eg. it was a

Re: [go-nuts] liteide x30.1 released

2016-07-06 Thread Constantin Konstantinidis
I couldn't locate the information. Could it be that liteIDE is only using LF and not Windows CRLF ? Is this an option ? It creates annoyances with other resources on Windows. Thank you, On Wednesday, July 6, 2016 at 8:25:26 AM UTC+2, visualfc wrote: > > The x30.1 has windows close bug, fix and

Re: [go-nuts] calling file.Write() concurrently

2016-07-06 Thread Pierre Durand
My solution: https://play.golang.org/p/f5H0svLFE0 What do you think ? Le mardi 5 juillet 2016 15:30:38 UTC+2, Jan Mercl a écrit : > > > On Tue, Jul 5, 2016 at 11:38 AM Pierre Durand > wrote: > > > It works as expected, but in my real code, I'd prefer to avoid mutex. > > Sounds like a case for usi

Re: [go-nuts] go1.6 buildmode=shared error on linux/amd64

2016-07-06 Thread Peter Waller
Hi Serhat, I just encountered this too, while trying to get started. The solution in my case was to actually use Cgo in my go program. Simply adding `import "C"` fixed the problem. Hope that helps! - Peter On 3 March 2016 at 21:40, Serhat Şevki Dinçer wrote: > Hi, > When I do *go build -buil

Re: [go-nuts] calling file.Write() concurrently

2016-07-06 Thread Pierre Durand
Ooops, fixed my code: https://play.golang.org/p/vdwDT9WMVr Le mercredi 6 juillet 2016 11:44:33 UTC+2, Pierre Durand a écrit : > > My solution: https://play.golang.org/p/f5H0svLFE0 > What do you think ? > > Le mardi 5 juillet 2016 15:30:38 UTC+2, Jan Mercl a écrit : >> >> >> On Tue, Jul 5, 2016 at

Re: [go-nuts] calling file.Write() concurrently

2016-07-06 Thread Tamás Gulácsi
Seems ok. -- 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 golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.

Re: [go-nuts] calling file.Write() concurrently

2016-07-06 Thread Daniel K
Looks good, but you could take advantage of the io writer interface. I made a quick example, not sure if it runs (did not test) https://play.golang.org/p/cYcz2ktoiG Den onsdag den 6. juli 2016 kl. 11.44.33 UTC+2 skrev Pierre Durand: > > My solution: https://play.golang.org/p/f5H0svLFE0 > What do

Re: [go-nuts] calling file.Write() concurrently

2016-07-06 Thread Pierre Durand
@Tamás Gulácsi: thank you for your review. @Daniel K: yes, it was my original idea, but I quickly discarded it, because I can't guarantee that LineAppender is safe for concurrent usage. If you give it a wrong io.WriteCloser, it will be unsafe to use concurrently. Le mercredi 6 juillet 2016 12:4

[go-nuts] Sqlite Compile error in windows.

2016-07-06 Thread kumargv
hello guys, i am trying to download this pkg go get github.com/xeodou/go-sqlcipher I am using TDM-GCC C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lcrypto collect2.exe: error: ld returned 1 exit status I tried every possible way

Re: [go-nuts] What does -fm mean as a suffix for a runtime function name?

2016-07-06 Thread Jakob Borg
2016-07-06 7:10 GMT+02:00 Gregory Golberg : > Not really: https://play.golang.org/p/1-31t3prci ? > > This is the difference Matt is referring to: https://play.golang.org/p/MO_fEbZkeQ //jb -- You received this message because you are subscribed

Re: [go-nuts] Vendored trace package causes panic because of implicit handlers

2016-07-06 Thread Jakob Borg
2016-07-06 9:11 GMT+02:00 Peter Bourgon : > You can't actually make this distinction. > There should be a single vendor/ dir at the root of the repo. > See https://github.com/zellyn/wtf2 for a demonstration. > (And https://github.com/peterbourgon/wtf for context.) Indeed. Which means that vendorin

Re: [go-nuts] Vendored trace package causes panic because of implicit handlers

2016-07-06 Thread Ian Davis
On Wed, Jul 6, 2016, at 12:34 PM, Jakob Borg wrote: > 2016-07-06 9:11 GMT+02:00 Peter Bourgon : > > You can't actually make this distinction. > > There should be a single vendor/ dir at the root of the repo. > > See https://github.com/zellyn/wtf2 for a demonstration. > > (And https://github.com/pet

[go-nuts] GoLang Https Client doesn't work - php curl does. HELP

2016-07-06 Thread gobasu
Hi guys, I am currently working on integration of my system with 3rd party api. They provide us a test server and SSL certificates for it. When I try to use golang to connect it I am getting errror : *remote error: bad certificate *where code in php works with the same certificates. Can anyone

[go-nuts] Without normalisation is there any way of iterating over this string by grapheme?

2016-07-06 Thread gary . willoughby
I have a little snippet here which iterates over a string. package main import "fmt" func main() { text := "Noël" for _, rune_ := range text { fmt.Printf("%#U\n", rune_) } } Playground: https://play.golang.org/p/bVfXB2crKo The output is not correct because it breaks the 'e' from the diaeres

Re: [go-nuts] function with goroutine returned will kill its goroutine?

2016-07-06 Thread 'Paul Borman' via golang-nuts
You probably should say all goroutines are terminated when main exits (or os.Exit is called or the program abnormally terminates), lest someone complain that their defer functions were not run. On Tue, Jul 5, 2016 at 12:29 PM, Christoph Berger < christoph.g.ber...@gmail.com> wrote: > In addition

[go-nuts] Re: Without normalisation is there any way of iterating over this string by grapheme?

2016-07-06 Thread Egon
On Wednesday, 6 July 2016 17:31:06 UTC+3, gary.wi...@victoriaplumb.com wrote: > > I have a little snippet here which iterates over a string. > > package main > > import "fmt" > > func main() { > > text := "Noël" > > for _, rune_ := range text { > fmt.Printf("%#U\n", rune_) > } > } > > Playgroun

Re: [go-nuts] liteide x30.1 released

2016-07-06 Thread guagua
kubernetes跳转到函数定义太慢 在 2016年7月6日星期三 UTC+8下午2:25:16,visualfc写道: > > The x30.1 has windows close bug, fix and reload download files x30.1-1 > source: https://github.com/visualfc/liteide > download1: https://sourceforge.net/projects/liteide/files/X30.1-1 > download2: http://git.oschina.net/visualfc/li

Re: [go-nuts] Re: Without normalisation is there any way of iterating over this string by grapheme?

2016-07-06 Thread Rob Pike
Here it is without the combining character: https://play.golang.org/p/1bgIkIbFei Ranging over a string iterates the code points within. For...range is unaware of combining characters; they are a higher-level concept. The package described at https://godoc.org/golang.org/x/text/unicode/norm might

Re: [go-nuts] Re: Without normalisation is there any way of iterating over this string by grapheme?

2016-07-06 Thread gary . willoughby
Thanks. Though I understand what is happening, I wondered if Go includes ways to handle such text at the grapheme level? I only see libraries aimed at the code point level. On Wednesday, 6 July 2016 15:59:30 UTC+1, Rob 'Commander' Pike wrote: > > Here it is without the combining character: > h

[go-nuts] I just read an article. In my understanding, it states single word reads/writes in go are atomic, is it right?

2016-07-06 Thread T L
http://research.swtch.com/gorace > ... > The race is fundamentally caused by being able to observe partial updates > to Go's multiword values (slices, interfaces, and strings): the updates are > not atomic. > > The fix is to make the updates atomic. In Go, the easiest way to do that > is t

Re: [go-nuts] I just read an article. In my understanding, it states single word reads/writes in go are atomic, is it right?

2016-07-06 Thread Jan Mercl
On Wed, Jul 6, 2016 at 5:33 PM T L wrote: Certainly sized and/or certainly aligned memory writes are atomic on certain CPU architectures. But it is only the Go language specification and the Go memory model where guaranties one _may_ rely on [across architectures] are found. -- -j -- You r

Re: [go-nuts] I just read an article. In my understanding, it states single word reads/writes in go are atomic, is it right?

2016-07-06 Thread 'Axel Wagner' via golang-nuts
You are misreading this. a) it implicitly refers to a single architecture and b) it doesn't say that single-word accesses are atomic, it says that multi-word accesses are inherently non-atomic. Making it a single-word access is necessary but not sufficient, to actually get atomic reads/writes you n

Re: [go-nuts] I just read an article. In my understanding, it states single word reads/writes in go are atomic, is it right?

2016-07-06 Thread T L
On Wednesday, July 6, 2016 at 11:38:58 PM UTC+8, Axel Wagner wrote: > > You are misreading this. a) it implicitly refers to a single architecture > and b) it doesn't say that single-word accesses are atomic, it says that > multi-word accesses are inherently non-atomic. > I can't get the concl

Re: [go-nuts] I just read an article. In my understanding, it states single word reads/writes in go are atomic, is it right?

2016-07-06 Thread 'Axel Wagner' via golang-nuts
I am aware who wrote that article (I read it a couple of years ago and even wrote an unsafe package based on it for fun, though never published it) and no, it doesn't imply that at all. It makes certain assurances for a particular compiler (gc) and a particular set of architectures (x86{,_64},…) at

Re: [go-nuts] Sqlite Compile error in windows.

2016-07-06 Thread Konstantin Khomoutov
On Wed, 6 Jul 2016 04:13:43 -0700 (PDT) kumargv wrote: > i am trying to download this pkg > go get github.com/xeodou/go-sqlcipher > > I am using TDM-GCC > > C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: > > cannot find -lcrypto > collect2.exe

Re: [go-nuts] I just read an article. In my understanding, it states single word reads/writes in go are atomic, is it right?

2016-07-06 Thread Konstantin Khomoutov
On Wed, 6 Jul 2016 08:55:03 -0700 (PDT) T L wrote: > > > On Wednesday, July 6, 2016 at 11:38:58 PM UTC+8, Axel Wagner wrote: > > > > You are misreading this. a) it implicitly refers to a single > > architecture and b) it doesn't say that single-word accesses are > > atomic, it says that multi-w

Re: [go-nuts] Re: Without normalisation is there any way of iterating over this string by grapheme?

2016-07-06 Thread Sonia Keys
It might be enough for you to just check for combining characters, something like https://play.golang.org/p/-eKwUWTHV0. (I think there's Mc and Me and then other grapheme considerations beyond combining characters, but this may be all you need.) On Wednesday, July 6, 2016 at 3:19:56 PM UTC, ga

[go-nuts] Re: Without normalisation is there any way of iterating over this string by grapheme?

2016-07-06 Thread Manlio Perillo
Il giorno mercoledì 6 luglio 2016 16:31:06 UTC+2, gary.wi...@victoriaplumb.com ha scritto: > > I have a little snippet here which iterates over a string. > > package main > > import "fmt" > > func main() { > > text := "Noël" > > for _, rune_ := range text { > fmt.Printf("%#U\n", rune_) > } > } >

Re: [go-nuts] Error vs. Panic: Should functions like strings.Repeat return an error value?

2016-07-06 Thread Anmol Sethi
What about gzip.NewWriterLevel(w, level)? It returns an error if level is invalid. Shouldn’t it panic instead if the level is invalid? > On Jun 30, 2016, at 12:30 PM, Andy Balholm wrote: > > When a function is used incorrectly, a panic is appropriate. If the count > comes from an untrusted sou

Re: [go-nuts] String Split Question

2016-07-06 Thread Edward Muller
https://play.golang.org/p/fOFT2voh6l > On Jul 5, 2016, at 2:57 PM, Freeman Fridie wrote: > > I have a data file with records in the following format: > > [field 1][field 2][field 3][field 4]... > > I need to be able to split the record into fields using

Re: [go-nuts] function with goroutine returned will kill its goroutine?

2016-07-06 Thread Christoph Berger
Good point, thanks. Yes, when the process exits, the goroutines end immediately without running their defer functions. > Am 06.07.2016 um 16:47 schrieb Paul Borman : > > You probably should say all goroutines are terminated when main exits (or > os.Exit is called or the program abnormally term

Re: [go-nuts] GoLang Https Client doesn't work - php curl does. HELP

2016-07-06 Thread Brad Fitzpatrick
You only need to set tls.Config.InsecureSkipVerify. Don't set Certificates and ServerName. Of course, you should not use InsecureSkipVerify for using a third-party API at all. InsecureSkipVerify is really only meant for localhost testing. You want to use https://golang.org/pkg/crypto/x509/#NewCer

[go-nuts] golang time.Duration calculation

2016-07-06 Thread Tong Sun
I know golang time.Duration supports basic calculations. but the problem I'm trying to answer is, How many *100 seconds *does *one hour *has? This is my code: https://play.golang.org/p/HnwY8pDxL8 It's not fully working. Please help. Thanks -- You received this message because you are subscri

[go-nuts] Registering a Go app as a protocol handler under Mac OS X

2016-07-06 Thread chris . snell
Hi, I'm trying to hook up a Go application to a URL protocol handler in Mac OS X. I want a user to be able to click on a link such as myapp://foo/bar and have that launch myapp and be able to access the full query parameters. I've made it as far as getting the OS to register the handler and l

[go-nuts] Re: golang time.Duration calculation

2016-07-06 Thread Tong Sun
oh, please make it *65 seconds*, I need the float point calculations. On Wednesday, July 6, 2016 at 5:43:55 PM UTC-4, Tong Sun wrote: > > I know golang time.Duration supports basic calculations. but the problem > I'm trying to answer is, > > How many *100 seconds *does *one hour *has? > > This i

Re: [go-nuts] golang time.Duration calculation

2016-07-06 Thread Rob Pike
Just divide the durations: https://play.golang.org/p/ILE11eLzSx On Wed, Jul 6, 2016 at 2:43 PM, Tong Sun wrote: > I know golang time.Duration supports basic calculations. but the problem > I'm trying to answer is, > > How many *100 seconds *does *one hour *has? > > This is my code: > https://p

Re: [go-nuts] golang time.Duration calculation

2016-07-06 Thread Tong Sun
oh, please make it *65 seconds*, https://play.golang.org/p/JiftSjddjx I need the float point calculations. I.e., I need to result to be 55.38, instead of 55. On Wednesday, July 6, 2016 at 5:53:37 PM UTC-4, Rob 'Commander' Pike wrote: > > Just divide the durations: https://play.golang.org/p/

Re: [go-nuts] golang time.Duration calculation

2016-07-06 Thread Tong Sun
To make the point, let's use *68 seconds*, https://play.golang.org/p/mfuJQa3_65 I need the result to be 52.94, instead of 52. On Wednesday, July 6, 2016 at 5:55:18 PM UTC-4, Tong Sun wrote: > > > oh, please make it *65 seconds*, > > https://play.golang.org/p/JiftSjddjx > > I need the float p

Re: [go-nuts] String Split Question

2016-07-06 Thread Justin Israel
On Thu, Jul 7, 2016 at 7:43 AM Edward Muller wrote: > https://play.golang.org/p/fOFT2voh6l > That's pretty sweet. > > On Jul 5, 2016, at 2:57 PM, Freeman Fridie wrote: > > I have a data file with records in the following format: > > [field 1][field 2][field 3][field 4]... > > I need to be abl

Re: [go-nuts] golang time.Duration calculation

2016-07-06 Thread Dan Kortschak
Type convert *prior* to the division. https://play.golang.org/p/7cwTFu_3im On Wed, 2016-07-06 at 15:01 -0700, Tong Sun wrote: > To make the point, let's use *68 seconds*, > > https://play.golang.org/p/mfuJQa3_65 > > I need the result to be 52.94, instead of 52. -- You received this message

[go-nuts] GoBridge Appreciation Breakfast @ GopherCon

2016-07-06 Thread Edward Muller
We (Heroku) are sponsoring the Gophercon 2016 kickoff breakfast of gratitude: http://www.meetup.com/gobridge/events/229149949/ Please sign up if you are interested. Thanks! -- You received this message because you are subscribed to the Google

Re: [go-nuts] Error vs. Panic: Should functions like strings.Repeat return an error value?

2016-07-06 Thread Andy Balholm
Yes, panic would probably have been a better choice there. In the API cleanups leading up to Go 1, the team removed some of the error returns from the NewWriter functions in the compress/* packages (https://codereview.appspot.com/5639057), but maybe it would have been good to go farther. Andy

Re: [go-nuts] Error vs. Panic: Should functions like strings.Repeat return an error value?

2016-07-06 Thread Dave Cheney
Why panic, the method returns an error value that can be used to tell the caller they made a mistake. -- 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 golang-nuts

Re: [go-nuts] Error vs. Panic: Should functions like strings.Repeat return an error value?

2016-07-06 Thread Andy Balholm
In this particular case, the only possible error is that the compression level is invalid. The documentation says that the error will be nil if the level is valid. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group a

Re: [go-nuts] Error vs. Panic: Should functions like strings.Repeat return an error value?

2016-07-06 Thread Dave Cheney
If this function panic'd then people who raise issues to make it not panic, or they would work around it with recover(), both of which would be in less tested code paths. If this function accepted any integer for level and silently clamped it to a reasonable minimum or maximum value, then peopl

Re: [go-nuts] Matrix Library && colour uint32's vs uint8's

2016-07-06 Thread Nigel Tao
On Mon, Jul 4, 2016 at 2:50 PM, simran wrote: > Interestingly though, when i do a colour swap (without any type casting > happening now) - the colour problem is still there. https://github.com/simran91/monkeysee/blob/master/mimage/mimage.go says: r, g, b, a := colour.RGBA() column[y] = color.RG

Re: [go-nuts] What versions of mobile OS does go.mobile work on?

2016-07-06 Thread Hyang-Ah Hana Kim
For Android, min API level is 15, ice cream sandwich. The gomobile doc needs update - it mentions API 9. For iOS, I think iOS 8.3 was the earliest one I happened to use (iphone5/6). On Fri, Jul 1, 2016 at 10:51 PM, wrote: > Hi, > > I am considering to write a shared library that works on > both

[go-nuts] java.lang.UnsatisfiedLinkError: Native method not found: go.Universe.init:()V

2016-07-06 Thread Lewis Deng
1. What version of Go are you using (go version)? go version go1.6.2 linux/amd64 2. What operating system and processor architecture are you using (go env)? GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/g

Re: [go-nuts] Matrix Library && colour uint32's vs uint8's

2016-07-06 Thread simran
Hi Nigel, Thankyou so very very much mate. This really fixed up the colour issues i was having - really can't thank you enough for pointing this out, it was eluding me for a long time (and probably would have continued to), but as soon as you mentioned it, it makes perfect sense of course :) I ow

[go-nuts] Re: java.lang.UnsatisfiedLinkError: Native method not found: go.Universe.init:()V

2016-07-06 Thread Lewis Deng
bind/genjava.go if g.pkg == nil { g.Printf("clazz = (*env)->FindClass(env, %q);\n", "go/Universe$"+s.obj.Name()) } else { g.Printf("clazz = (*env)->FindClass(env, %q);\n", g.jniClassSigPrefix(s.obj.Pkg())+s.obj.Name()) } this is a temporary measure, please fix it, thanks On Thursday, July 7,