[go-nuts] Re: Search for Another JSON Package

2016-08-24 Thread dc0d
Thanks; the problem is I'm using a third party package with lots of data-structures and those data is going into CouchDB and deserializing would set the IEEE 754 hell loose. Also the `IntegerAsString` on `codec.JsonHandle` in ugorji package does not works - created an issue for that. I ended u

[go-nuts] gomobile. Not able to build IOS apps.

2016-08-24 Thread Joe Blue
hey everyone, The problem is that i cant build a simple gomobile app for IOS. I can build a normal (swift) IOS project in the Simulator & IPhone. I can build the golang app for Android. The public git repo of the Test Harness project is here: https://bitbucket.org/gedw99/md-mobile-x Its ju

Re: [go-nuts] ListenAndServe without alert

2016-08-24 Thread Joe Blue
Got it. thanks On Thu, Aug 25, 2016 at 5:03 AM Matt Harden wrote: > I don't think signing has anything to do with Go itself. You sign the > binary executable file that your tool generates, regardless of the language > it was written in. > > On Wed, Aug 24, 2016 at 2:16 AM Joe Blue wrote: > >>

Re: [go-nuts] Syntax errors involving compound literals

2016-08-24 Thread Ian Lance Taylor
On Wed, Aug 24, 2016 at 9:21 PM, sbkim via golang-nuts wrote: > Hello group, > > Why are the following snippets errors? > > https://play.golang.org/p/mgEYMNNw9h > type S struct { > i int > } > > if S{i: 0} == S{} { > } > syntax error: unexpected == at end of statement > > switch S{i: 0} == S{}

[go-nuts] Re: gosyms - ordered, indexed symbol tables

2016-08-24 Thread fncodr
self is a preference, I prefer not wasting brain power thinking up new names for receivers. The custom bsearch is twice as fast, probably because of no method calls; anyway, it's not rocket surgery. Did you see the benchmarks section in the README? /fncodr Den torsdag 25 augusti 2016 kl. 06:01

[go-nuts] Syntax errors involving compound literals

2016-08-24 Thread sbkim via golang-nuts
Hello group, Why are the following snippets errors? https://play.golang.org/p/mgEYMNNw9h type S struct { i int } if S{i: 0} == S{} { } syntax error: unexpected == at end of statement switch S{i: 0} == S{} { } syntax error: unexpected i, expecting case or default or } It works without erro

[go-nuts] Re: gosyms - ordered, indexed symbol tables

2016-08-24 Thread Tamás Gulácsi
Using "self" is not idiomatic in go. Aside this little naming convention, as I see, GetSym reimplements sort.Search, which is unnecessary. Have you benchmarked this against a sorted slice of strings? -- You received this message because you are subscribed to the Google Groups "golang-nuts" gro

Re: [go-nuts] In the future, how to keep runtime.KeepAlive from dead code elimination?

2016-08-24 Thread Ian Lance Taylor
On Wed, Aug 24, 2016 at 7:06 PM, Cholerae Hu wrote: > > I've read the source of package runtime, and found that runtime.KeepAlive is > an empty function. If go compiler can do dead code elimination in the > future, how to protect runtime.KeepAlive from being optimized? The KeepAlive function is m

[go-nuts] In the future, how to keep runtime.KeepAlive from dead code elimination?

2016-08-24 Thread Cholerae Hu
Hi all, I've read the source of package runtime, and found that runtime.KeepAlive is an empty function. If go compiler can do dead code elimination in the future, how to protect runtime.KeepAlive from being optimized? -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] time: time.Parse's Location

2016-08-24 Thread Matt Harden
Sorry, that's time.Local = time.UTC. On Wed, Aug 24, 2016 at 8:26 PM Matt Harden wrote: > Note that ParseInLocation(..., time.UTC) should give you the same behavior > in both test scenarios. If you have to use Parse, you can set time.Location > = time.UTC, with the same result. > > On Wed, Aug 2

Re: [go-nuts] time: time.Parse's Location

2016-08-24 Thread Matt Harden
Note that ParseInLocation(..., time.UTC) should give you the same behavior in both test scenarios. If you have to use Parse, you can set time.Location = time.UTC, with the same result. On Wed, Aug 24, 2016 at 10:05 AM wrote: > Thanks for the response! > > On Wednesday, August 24, 2016 at 7:16:00

Re: [go-nuts] ListenAndServe without alert

2016-08-24 Thread Matt Harden
I don't think signing has anything to do with Go itself. You sign the binary executable file that your tool generates, regardless of the language it was written in. On Wed, Aug 24, 2016 at 2:16 AM Joe Blue wrote: > Thanks for the tips !! > > The 127.0.0.1 seems to have worked on Windoze. > > Sig

[go-nuts] Re: expvar when not using global mux

2016-08-24 Thread Flowerinthenight
Check this out: http://flowerinthenight.com/blog/2016/08/20/expvar-gorilla-mux On Monday, August 22, 2016 at 4:48:26 AM UTC+9, Amit Upadhyay wrote: > > expvar registers expvarHandler as init(), which registers it to global > mux. This is convenient in general. In my app I have a non global mux,

[go-nuts] Re: gosyms - ordered, indexed symbol tables

2016-08-24 Thread fncodr
Oh, and any ideas on how to squeeze some more performance out of this or otherwise improve the code are most welcome, of course. /fncodr Den torsdag 25 augusti 2016 kl. 02:36:55 UTC+2 skrev fnc...@gmail.com: > > gosyms provides symbols that sort effectively by comparing index instead > of name.

Re: [go-nuts] Named embedded structs?

2016-08-24 Thread Sam Salisbury
Not really, go packages are just right as they are IMO. I would just like to be able to refer to that embedded type by name, e.g. to compose parts of the struct separately, whilst keeping the definition of the larger type including its embedded types in one place. On Thursday, 25 August 2016, Ju

[go-nuts] gosyms - ordered, indexed symbol tables

2016-08-24 Thread fncodr
gosyms provides symbols that sort effectively by comparing index instead of name. It accomplishes this by using ordered, binary searched slices for tables. For the price of generating symbols before use, you get orders of magnitude performance boosts in any string sorting scenario. https://gith

Re: [go-nuts] Language Feature Proposal: define

2016-08-24 Thread tommy xiao
yes, the type is you want. 2016-08-21 19:16 GMT+08:00 Henry : > Uh oh. You're right. Thanks for reminding me. Somehow I missed that. > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails

Re: [go-nuts] Named embedded structs?

2016-08-24 Thread Justin Israel
Is this effectively just trying to achieve namespacing within a package? On Thu, Aug 25, 2016 at 11:09 AM Sam Salisbury wrote: > It would just mean that all embedded struct types introduce a new type > named "(parent struct type name).(field name)|, that you could use as if it > were any other t

Re: [go-nuts] Named embedded structs?

2016-08-24 Thread Sam Salisbury
It would just mean that all embedded struct types introduce a new type named "(parent struct type name).(field name)|, that you could use as if it were any other type (albeit with a dot, not currently allowed in type names). Sometimes it's nice to define a type as part of another type to see a dee

Re: [go-nuts] Named embedded structs?

2016-08-24 Thread Jan Mercl
On Thu, Aug 25, 2016, 00:08 Sam Salisbury wrote: > Would it be nice or nasty for this to work? > https://play.golang.org/p/iCTKx3gF_2 > > Copy-pasted: > > type Thing struct { > Embedded struct { > Name string > } > } > > func main() { > x := Thing.Embedded{Name: "Barry"} > fmt.Println(x.Thing.Nam

[go-nuts] Re: Named embedded structs?

2016-08-24 Thread Sam Salisbury
Correction: https://play.golang.org/p/T4Lq07xDgl func main() { x := Thing.Embedded{Name: "Barry"} fmt.Println(x.Name) // output: // Barry } This is what happens when I can't rely on the compiler... On Wednesday, 24 August 2016 23:07:59 UTC+1, Sam Salisbury wrote: > > Would it be nice or nasty

[go-nuts] Named embedded structs?

2016-08-24 Thread Sam Salisbury
Would it be nice or nasty for this to work? https://play.golang.org/p/iCTKx3gF_2 Copy-pasted: type Thing struct { Embedded struct { Name string } } func main() { x := Thing.Embedded{Name: "Barry"} fmt.Println(x.Thing.Name) // output: // Barry } Seems it would be useful to me to be able to do

[go-nuts] Re: Why a **T value can't call methods of *T and T if a *T value can call methods of T?

2016-08-24 Thread xiiophen
It doesn't/wouldn't seem to be any technical issue implementing methods on any depth of pointer type .. as demonstrated in the unsafe example linked from a previous related discussion (ie https://groups.google.com/forum/#!msg/golang-nuts/qf76N-uDcHA/DTCDNgaF_p4J ) It's not allowed by the speci

Re: [go-nuts] (*TCPConn).SetNoPush?

2016-08-24 Thread Jingcheng Zhang
Thanks for the tips, I didn't know that reflect also applies to unexported members & methods before. On Wednesday, August 24, 2016 at 11:51:18 AM UTC+8, Matt Harden wrote: > > The golang.org/x/net/ipv4 package obtains the connection's file > descriptor by using reflection ( > https://github.com/

Re: [go-nuts] time: time.Parse's Location

2016-08-24 Thread nrjones8
Thanks for the response! On Wednesday, August 24, 2016 at 7:16:00 AM UTC-7, Ian Lance Taylor wrote: > > On Tue, Aug 23, 2016 at 10:58 PM, > > wrote: > > > > I was running into issues with comparing time.Time objects in a unit > test > > that would pass on a CI server, but fail on my local ma

[go-nuts] Re: Search for Another JSON Package

2016-08-24 Thread Ugorji Nwoke
https://godoc.org/github.com/ugorji/go/codec https://github.com/ugorji/go package name: github.com/ugorji/go/codec On Wednesday, August 24, 2016 at 5:30:10 AM UTC-4, dc0d wrote: > > Is there a JSON package that have these characteristics? > > >- can marshal numeric integer values to strings (l

[go-nuts] Using ETW in Go

2016-08-24 Thread Flowerinthenight
For those who are used to (or using) ETW for tracing/instrumentation in Windows services, I've created a rather inelegant solution here . I like being able to see real time logs in Windows services compared to using event logs. Any fee

[go-nuts] Re: Search for Another JSON Package

2016-08-24 Thread James Bardin
Can you use the json.Number type? https://play.golang.org/p/pKZeDJHkKK On Wednesday, August 24, 2016 at 5:30:10 AM UTC-4, dc0d wrote: > > Is there a JSON package that have these characteristics? > > >- can marshal numeric integer values to strings (like >using `json:",string"` tag) >

Re: [go-nuts] Re: Ideas for a Go interpeter, feedback requested

2016-08-24 Thread Seb Binet
Aram, On Mon, Aug 22, 2016 at 11:29 PM, Aram Hăvărneanu wrote: > On Mon, Aug 22, 2016 at 1:48 PM, Seb Binet wrote: > > do you think it would be feasable to have a GOARCH=vm backend which would > > just be the portable "Ken's National 32000" ASM, have all the ssa > > optimizations from the gc to

Re: [go-nuts] time: time.Parse's Location

2016-08-24 Thread Ian Lance Taylor
On Tue, Aug 23, 2016 at 10:58 PM, wrote: > > I was running into issues with comparing time.Time objects in a unit test > that would pass on a CI server, but fail on my local machine. I wanted to > see if anyone could double check my understanding of how `time.Parse` treats > locations (I posted o

Re: [go-nuts] Error: cannot use Value literal (type Value) as type []Value in field value

2016-08-24 Thread Anmol Sethi
So together it would look like []Values{Value{}} > On Aug 24, 2016, at 10:00 AM, j...@ramhorst.eu wrote: > > Hello, > I have a problem with structs: > > I defined the following structs: > > type Value struct { > Type string `json:"type"` > Unity string `json:"unity"` > Data float64 `json:

[go-nuts] Error: cannot use Value literal (type Value) as type []Value in field value

2016-08-24 Thread jens
Hello, I have a problem with structs: I defined the following structs: type Value struct { Type string `json:"type"` Unity string `json:"unity"` Data float64 `json:"data"` } type Phase struct { Phase int `json:"phase"` Name string `json:"name"` Values []Value `json:"values"` } typ

Re: [go-nuts] Allocating memory to consume a variable from channel in select statement

2016-08-24 Thread Ian Lance Taylor
On Wed, Aug 24, 2016 at 2:49 AM, Chintan Sheth wrote: > I am using select statement to dispatch work coming from multiple > goroutines, the variables used to consume the channel are allocated manually > as I am recycling those > > > for { > a := getA() > b := getB() > select { > case a = <-cha

Re: [go-nuts] Error: cannot use Value literal (type Value) as type []Value in field value

2016-08-24 Thread Anmol Sethi
slice* > On Aug 24, 2016, at 10:00 AM, j...@ramhorst.eu wrote: > > Hello, > I have a problem with structs: > > I defined the following structs: > > type Value struct { > Type string `json:"type"` > Unity string `json:"unity"` > Data float64 `json:"data"` > } > > > type Phase struct { >

Re: [go-nuts] Error: cannot use Value literal (type Value) as type []Value in field value

2016-08-24 Thread Anmol Sethi
Values is an array. So you need []Values{} > On Aug 24, 2016, at 10:00 AM, j...@ramhorst.eu wrote: > > Hello, > I have a problem with structs: > > I defined the following structs: > > type Value struct { > Type string `json:"type"` > Unity string `json:"unity"` > Data float64 `json:"data"

[go-nuts] time: time.Parse's Location

2016-08-24 Thread nrjones8
I was running into issues with comparing time.Time objects in a unit test that would pass on a CI server, but fail on my local machine. I wanted to see if anyone could double check my understanding of how `time.Parse` treats locations (I posted on Stack Overflow

[go-nuts] Re: Passing -v=10 flag to glog when running tests

2016-08-24 Thread imesh . gunaratne
On Thursday, May 12, 2016 at 11:33:40 PM UTC+5:30, edunc...@gmail.com wrote: > > This is what I use with glog in my test file(s): > > func init() { > if testing.Verbose() { > flag.Set("alsologtostderr", "true") > flag.Set("v", "5") > } > } > > (I just ran into this today, fyi) > Thanks! This was u

[go-nuts] Allocating memory to consume a variable from channel in select statement

2016-08-24 Thread Chintan Sheth
I am using select statement to dispatch work coming from multiple goroutines, the variables used to consume the channel are allocated manually as I am recycling those for { a := getA() b := getB() select { case a = <-chan1: go doSomething(&a) case b = <-chan2: go doSomething2(&b) } }

Re: [go-nuts] Invalid JSON document from 'go list -json std'

2016-08-24 Thread YOU
Just for the note that not only JSON, but MongoDB's .bson files store the same way as series for BSON documents without any separator between. On Tuesday, August 23, 2016 at 10:23:07 PM UTC+9, Jim Ancona wrote: > > This is a pretty common way of streaming JSON objects. See: > https://en.wikipedi

[go-nuts] TO Run Script/command as user in windows

2016-08-24 Thread kumargv
package main import ( "fmt" "github.com/contester/runlib/win32" "syscall" "unsafe" ) var PATH string = "C:\\Program Files (x86)\\Vistara\\Agent\\utils\\1.exe" var kernel32 = syscall.NewLazyDLL("kernel32.dll") var procCreatePipe = kernel32.NewProc("CreatePipe") func main() { var hTo

[go-nuts] Re: Search for Another JSON Package

2016-08-24 Thread C Banning
https://godoc.org/github.com/ugorji/go/codec supports this. On Wednesday, August 24, 2016 at 3:30:10 AM UTC-6, dc0d wrote: > > Is there a JSON package that have these characteristics? > > >- can marshal numeric integer values to strings (like >using `json:",string"` tag) >- can unmars

[go-nuts] Search for Another JSON Package

2016-08-24 Thread dc0d
Is there a JSON package that have these characteristics? - can marshal numeric integer values to strings (like using `json:",string"` tag) - can unmarshal numeric integer values from *either* string or the number; based on the type of the field (some field like `MessageID int64`)

Re: [go-nuts] ListenAndServe without alert

2016-08-24 Thread Joe Blue
Thanks for the tips !! The 127.0.0.1 seems to have worked on Windoze. Signing i will look at later. Not sure how to do that right now. I am not using the Electron tools for signing, icons, taskbars, packaging, software update. Instead I am going to be using golang tools only for all that. There a

[go-nuts] Re: How to add new architecture?

2016-08-24 Thread HWJ
For such questions you might be better off with https://groups.google.com/forum/#!forum/golang-dev Ok. See https://groups.google.com/forum/#!topic/golang-dev/T1TwiiVZj_Q and https://groups.google.com/forum/#!topic/golang-dev/svc7BAN5STA You can learn how the porting was done for mips6 and s390

Re: [go-nuts] ListenAndServe without alert

2016-08-24 Thread Jakob Borg
2016-08-24 9:59 GMT+02:00 Joe Blue : > Would be curious to know what others think. Maybe there is still a way to > make it never show the alert on Windows I don't know Windows very well on this point, but I wouldn't be surprised if proper code signing made this go away. It does on Mac OS X at

Re: [go-nuts] ListenAndServe without alert

2016-08-24 Thread Dave Cheney
Try listening on 127.0.0.1 not localhost, on osx at least this avoids the alert because it avoids the DNS lookup. -- 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

Re: [go-nuts] ListenAndServe without alert

2016-08-24 Thread Joe Blue
On OSX is does not show an alert for "localhost:8080" ever, but on windows it does. On Windows after running the server (.exe) 2 times it learns the rule, and stops showing the alert anymore. I then went into the firewalls rules, saw the rule for the exe, and deleted the rule, to confirm the c

[go-nuts] Re: Accessing Ms SQL Server with Go

2016-08-24 Thread brainman
I use github.com/alexbrainman/odbc to access mssql server from windows. Alex -- 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