[go-nuts] x/exp/shiny: is there a way to get screen DPI ?

2017-07-11 Thread djadala
Hi All, Question is in subject, May be i miss something obvious, but cant find how to get DPI golang.org/x/exp/shiny/screen doesn't mention anyting about dpi or resolution. thanks in advance, Djadala -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] What is Go's version of python's list data type?

2017-07-11 Thread Ian Lance Taylor
On Tue, Jul 11, 2017 at 9:20 PM, wrote: > > A python list can be written as: > > ["something", 1234, 56.78, "Another string"] > > What is Go's data type that has a similar structure / capability? The literal answer to your question is []interface{}{"something", 1234, 56.78, "Another string"}

[go-nuts] What is Go's version of python's list data type?

2017-07-11 Thread andy . army91
A python list can be written as: ["something", 1234, 56.78, "Another string"] What is Go's data type that has a similar structure / capability? Thanks for the help -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group

Re: [go-nuts] Re: go test -S: repeated symbols in assembly

2017-07-11 Thread Ian Lance Taylor
On Mon, Jul 10, 2017 at 3:31 PM, Francesc Campoy Flores wrote: > > I can confirm that the behavior only happens on Mac, tried the same on Linux > and the output contained each symbol only once. > > https://github.com/golang/go/issues/20976 Ah, sorry, reading out of order. I see that you can recr

Re: [go-nuts] go test -S: repeated symbols in assembly

2017-07-11 Thread Ian Lance Taylor
On Mon, Jul 10, 2017 at 3:01 PM, 'Francesc Campoy Flores' via golang-nuts wrote: > > I'm writing on compiler optimization and benchmarks, and one of the things I > do is `go test -bench=. -gcflags "-S"` > > This outputs the generated assembly, which allows me to point out when a > function call ha

Re: [go-nuts] Different behaviour in select when using SendStmt versus default CommCase

2017-07-11 Thread Ian Lance Taylor
On Tue, Jul 11, 2017 at 12:27 PM, wrote: > > This caught me out recently; there's definitely a gap in my understanding as > to how select works. Maybe it's caught other people out too? > > For one of my clients, I'd written an application that would try to read > data from a backend. There were m

Re: [go-nuts] time.Format lost timezone information

2017-07-11 Thread Ian Lance Taylor
On Tue, Jul 11, 2017 at 12:34 PM, xiaolan via golang-nuts wrote: > > The following time "t" is at PST time zone. However, after I ran this code, > the fmt.Println(t.Format(time.RFC3339)) gives me > > 2013-02-03T19:54:00Z > > which is UTC zone. I would expect it to be -07:00. > > const longForm =

Re: [go-nuts] Re: Named or unnamed struct initialisation? What is best practice?

2017-07-11 Thread Rader
I found the position of `[0]byte` in the struct matters. type bar2 struct { A int _ [0]byte } differs from type bar3 struct { _ [0]byte A int } see the full example On Wednesday, July 12, 2017 at 10:44:04 AM UTC+8, Rader wrote: > > they both have the

Re: [go-nuts] Re: Named or unnamed struct initialisation? What is best practice?

2017-07-11 Thread Rader Lei
they both have the same size, eg. following structs bar and bar2 both take 16 bytes memory on a x64 machine. package main import ( "fmt" "unsafe" ) type bar struct { A int _ bool } type bar2 struct { A int _ [0]byte } func main() { bar := bar{} bar2 := bar2{}

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

2017-07-11 Thread tao zhang
Nice! 在 2017年7月10日星期一 UTC+8下午9:10:44,visualfc写道: > > Hi all. > LiteIDE x32.1 released! > This version fix x32 bug. The folder custom GOPATH support subfolder > inherit parent folder setting. The gocode plugin support custom GOPATH > setting. Dlv debugger change to headless mode and fix kill proc

Re: [go-nuts] The log library

2017-07-11 Thread Rob Pike
The key word is simple. We wanted a minimum possible logging library that is easy to use and efficient, with the expectation that those wanting fancier, richer libraries could build their own and debate the right interface. That is exactly what has happened. See https://github.com/golang/glog for

Re: [go-nuts] Error in golang's playground example.

2017-07-11 Thread Rob Pike
It runs fine for me. I believe you might have typed something in that window. It is an editable box, and if you type something there unintentionally it may surprise you with an error. -rob On Wed, Jul 12, 2017 at 12:43 AM, wrote: > PFA > > -- > You received this message because you are subscri

[go-nuts] Call for Papers Microservices 2017

2017-07-11 Thread saverio . giallorenzo
- Call for Papers Microservices'17 1st International Conference on Microservices Odense, Denmark, October 23-27 (TBD, in Week 43), 2017 ht

[go-nuts] time.Format lost timezone information

2017-07-11 Thread xiaolan via golang-nuts
Hi, The following time "t" is at PST time zone. However, after I ran this code, the fmt.Println(t.Format(time.RFC3339)) gives me 2013-02-03T19:54:00Z which is UTC zone. I would expect it to be -07:00. const longForm = "Jan 2, 2006 at 3:04pm (MST)" t, _ := time.Parse(longForm, "Feb 3, 2013

[go-nuts] Different behaviour in select when using SendStmt versus default CommCase

2017-07-11 Thread james . abley
This caught me out recently; there's definitely a gap in my understanding as to how select works. Maybe it's caught other people out too? For one of my clients, I'd written an application that would try to read data from a backend. There were multiple instances of this backend (say one in Orego

[go-nuts] [ANN] Paperboy - an email campaign CLI (like Hugo for email newsletters and announcements)

2017-07-11 Thread Michael
Hey all, When I wanted to send an email announcement to a few customers, I didn't want to deal with any of the SaaS/WYSIWYG email newsletter services. So I started a Hugo-inspired email campaign engine that consumes a source directory to send bulk emails via SMTP. It is in a usable state (you

[go-nuts] The log library

2017-07-11 Thread Michael Soulier
Am I the only one who finds the log standard library a tad lacking? I expected to be able to set log verbosity, like logger.Debug, logger.Info, etc, and I expected thread safety. I noticed today that my log output from multiple loggers in different goroutines was interlaced. I wonder if I'm usi

[go-nuts] SSL HTTP proxy support

2017-07-11 Thread Michael Soulier
I am trying to test a proxy that is expecting an SSL handshake immediately, even if the client is going to use an SSL CONNECT method. The problem is that my Golang and Python test code both seem to have the same flaw. They connect to the proxy in the clear, and then issue a CONNECT, but the prox

[go-nuts] Re: justforfunc: a Go YouTube series

2017-07-11 Thread Val
Thanks Francesc for sharing this. Marked as not spam. On Tuesday, July 11, 2017 at 2:07:25 AM UTC+2, Francesc Campoy Flores wrote: > > Hi gophers, > > Sorry to spam you, but I'll do it only once! Today I published the episode > 15 of a YouTube series >

Re: [go-nuts] Named or unnamed struct initialisation? What is best practice?

2017-07-11 Thread 'Robert Rodgers' via golang-nuts
nice. > On Jul 5, 2017, at 8:44 PM, Dan Kortschak > wrote: > > On Wed, 2017-07-05 at 17:26 -0700, rsr via golang-nuts wrote: >> type bar struct { >>A int >>_ bool >> } > > > or `type bar struct { A int; _ [0]byte }` to avoid the additional byte use. > -- You received this message b

[go-nuts] Sorting json fields recursive

2017-07-11 Thread Tong Sun
Hi, Is there any existing code/package out there that can sort an arbitrary json string in all its nesting levels, so that the attributes at any level are in sorted order? thx. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

Re: [go-nuts] justforfunc: a Go YouTube series

2017-07-11 Thread Sam Whited
On Mon, Jul 10, 2017 at 7:07 PM, Francesc Campoy Flores wrote: > Sorry to spam you, but I'll do it only once! Today I published the episode 15 > of a YouTube series I've been working on for a while. Thanks Francesc, Spam away I say! Your videos are always a treat, I wanted to comment again that

Re: [go-nuts] Re: justforfunc: a Go YouTube series

2017-07-11 Thread Nyah Check
Awesome 👍🏿👏🏿 On Tue, 11 Jul 2017 at 12:08 wrote: > yes that s right, a good back to basics. > But not only, it also make sense of TeeReader ( > https://golang.org/pkg/io/#TeeReader). > > Also, i wanted to comment afterward that none of fmt.Fprintf(os.Stderr / > log.PrintF are perfect. > Using fm

[go-nuts] job opportunities

2017-07-11 Thread Jennifer Quillent
Hello, I am looking for 3 Go developpeurs in Paris. Is anyone available for a project ? Jennifer QUILLENT Ingénieur Commercial 5COM-Consulting 06 03 25 44 10 01 48 25 25 14 www.Lab5com.fr --- L'absence de virus dans ce courrier électronique a été

[go-nuts] Re: justforfunc: a Go YouTube series

2017-07-11 Thread mhhcbon
yes that s right, a good back to basics. But not only, it also make sense of TeeReader (https://golang.org/pkg/io/#TeeReader). Also, i wanted to comment afterward that none of fmt.Fprintf(os.Stderr / log.PrintF are perfect. Using fmt, its laboriously long to write, using log.Printf, it might no

Re: [go-nuts] why I got a panic in this code?

2017-07-11 Thread Harley Laue
You didn't initialize the value of "pos" so the slice is effectively nil On Tue, Jul 11, 2017 at 2:24 AM, Fino wrote: > https://play.golang.org/p/2Wd9xlztBr > > > package main > import ( > "fmt" > ) > func Fix(raw []float32, raw_prev []float32, accumulated []float32, > threshold float32) (pos [

Re: [go-nuts] why I got a panic in this code?

2017-07-11 Thread Jan Mercl
On Tue, Jul 11, 2017 at 11:24 AM Fino wrote: > https://play.golang.org/p/2Wd9xlztBr Because of the reason the runtime error message unambiguously says: index out of range. Check https://play.golang.org/p/AZ3FEWUyPm -- -j -- You received this message because you are subscribed to the Google

[go-nuts] why I got a panic in this code?

2017-07-11 Thread Fino
https://play.golang.org/p/2Wd9xlztBr package main import ( "fmt" ) func Fix(raw []float32, raw_prev []float32, accumulated []float32, threshold float32) (pos []float32) { for i := 0; i < 3; i++ { if raw[i]-raw_prev[i] >= threshold { accumulated[i] -= 360 } else if raw[i]-raw_prev[i] <=