[go-nuts] Re: Project architecture

2017-03-12 Thread James Pettyjohn
Aye, this is some ways down the road now - quite a few projects on this base template. Only real complaint is: - Submodules get out of date where data is concerned - Some submodules contain a lot of data and so bloat deployment (e.g. maxmind) - cgo dependency leading to: can't use a blank docker

[go-nuts] Re: Project architecture

2017-03-12 Thread James Pettyjohn
I tried this once and I don't know that I effectively decoupled the direct cgo dependency. Any pointers on effectively doing this? On Saturday, March 11, 2017 at 11:22:03 PM UTC-8, Tamás Gulácsi wrote: > > Factor out the cgo related part into a wrapper package (subdir), that will > help with the

[go-nuts] Re: No Allman-Style, No go!

2017-03-12 Thread xiiophen
Attempt to clarify the behaviour - your problem is happening because of the line in the specification in https://golang.org/ref/spec#Semicolons which states *When the input is broken into tokens, a semicolon is automatically inserted into the token stream immediately after a line's final to

[go-nuts] Re: No Allman-Style, No go!

2017-03-12 Thread xiiophen
Duh .. Apologies for the previous post - I only read the first page of responses - didn't realise this discussion had extended to several pages .. it probably repeats stuff that had been said several times before. -- You received this message because you are subscribed to the Google Groups "go

[go-nuts] Re: Simple design question: method or function?

2017-03-12 Thread shahamit2
Please check https://grisha.org/blog/2016/09/22/golang-receiver-vs-function/ On Wednesday, March 2, 2016 at 1:04:55 AM UTC+5:30, Julio Guerra wrote: > > After all these years, this excellent question is still not clearly > answered... This point of the language makes this design decision really

[go-nuts] [ANN] G3N - Go 3D Game Engine

2017-03-12 Thread leonsal
Hi All, G3N is an OpenGL 3D Game Engine written in Go: https://github.com/g3n/engine Try out the game engine demo at: https://github.com/g3n/g3nd Regards. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and st

Re: [go-nuts] [ANN] G3N - Go 3D Game Engine

2017-03-12 Thread David Peacock
On Sat, Mar 11, 2017 at 5:14 PM, leonsal wrote: > G3N is an OpenGL 3D Game Engine written in Go: https://github.com/g3n/ > engine > Try out the game engine demo at: https://github.com/g3n/g3nd > > This is very welcome indeed. Massive kudos! Thank you! David 😁 -- You received this message bec

[go-nuts] Re: [ANN] G3N - Go 3D Game Engine

2017-03-12 Thread 'simon place' via golang-nuts
interesting, something i'm active around. just checking, the only dependency for the compiled result is opengl? On Sunday, 12 March 2017 14:52:51 UTC, leonsal wrote: > > Hi All, > > G3N is an OpenGL 3D Game Engine written in Go: > https://github.com/g3n/engine > Try out the game engine demo at:

[go-nuts] fixed precision formatting of floating point

2017-03-12 Thread 'simon place' via golang-nuts
when trying to compare two floats, for testing, i ran into the usual problems with rounding. so, i thought, a nice way out would be to compare their fixed precision formatted strings. which works except, fmt "%f" fixed precision still contains an unnecessary rounding issue; when the float is

[go-nuts] Re: [ANN] G3N - Go 3D Game Engine

2017-03-12 Thread leonsal
Output of *ldd* of the G3N demo (G3ND) in my Linux box: linux-vdso.so.1 => (0x7ffebade6000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x7f9b136e7000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x7f9b134ca000) libGL.so.1 => /usr/lib/nvidia-367/libGL.so.1 (0x7f

[go-nuts] Re: [ANN] G3N - Go 3D Game Engine

2017-03-12 Thread 'simon place' via golang-nuts
OK, i see X server in there, unfortunately the target system i was currently looking at doesn't have x support, just egl. -- 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 e

[go-nuts] What happens when appending to a slice exceeds the backing capacity?

2017-03-12 Thread st ov
What happens when appending to a slice exceeds the backing capacity? https://play.golang.org/p/mVezWL4Cbe In the example given, appending within capacity on line 20 modifies the backing array at the successive index. But on line 26, when appending exceeds the capacity, the backing array is no l

[go-nuts] Re: What happens when appending to a slice exceeds the backing capacity?

2017-03-12 Thread st ov
pasting code for convenience func main() { // create backing array arr := [5]int {0,1,2,3,4} fmt.Println(arr) // take a slice of backing array s1 := arr[:3] fmt.Println(s1) fmt.Println(arr) fmt.Println(cap(s1)) // append to slice, replaces backing

Re: [go-nuts] Re: What happens when appending to a slice exceeds the backing capacity?

2017-03-12 Thread Jan Mercl
On Sunday, March 12, 2017 at 11:49:33 AM UTC-7, st ov wrote: > What happens when appending to a slice exceeds the backing capacity? If the capacity of s is not large enough to fit the additional values, append allocates a new, sufficiently large underlying array that fits both the existing slice

[go-nuts] Re: [ANN] G3N - Go 3D Game Engine

2017-03-12 Thread leonsal
The dependencies on the X server are needed by the GLFW window manager ( *http://www.glfw.org*). We tried to abstract the window manager in the "window" package. So it would be theoretically possible to build another window manager using a Go binding for an EGL library and use it with the engine.

[go-nuts] Re: [ANN] G3N - Go 3D Game Engine

2017-03-12 Thread 'simon place' via golang-nuts
thanks for confirming that, i was guessing you had done that for x-platform support anyway. i started making a 3d viewer myself with glfw last year, its as much shader as possible, not worked on it recently, apart from looking at non-x solutions. On Sunday, 12 March 2017 19:16:58 UTC, leonsal

[go-nuts] Re: fixed precision formatting of floating point

2017-03-12 Thread peterGo
simon, The IEEE Standard for Floating-Point Arithmetic (IEEE 754) defines sets of binary and decimal floating-point data, which consist of finite numbers (including signed zeros and subnormal numbers), infinities, and special "not a number" values (NaNs). Signed Zero: https://en.wikipedia.org/

Re: [go-nuts] Re: What happens when appending to a slice exceeds the backing capacity?

2017-03-12 Thread st ov
Thanks! anyway to get a reference to that new array without using reflect? On Sunday, March 12, 2017 at 12:13:03 PM UTC-7, Jan Mercl wrote: > > On Sunday, March 12, 2017 at 11:49:33 AM UTC-7, st ov wrote: > > > What happens when appending to a slice exceeds the backing capacity? > > If the capac

[go-nuts] Re: fixed precision formatting of floating point

2017-03-12 Thread 'simon place' via golang-nuts
this isn't a signed zero, this is a very small negative float rounded off by fmt. it has as little actual different to zero as is possible to get (in float64 in this case) so will make as little difference to further calculation as it is possible to get. so either "-0.00" or " 0.00" ar

[go-nuts] Re: fixed precision formatting of floating point

2017-03-12 Thread 'simon place' via golang-nuts
thinking about it another way, its noise, no human reading the output would even need to know if the value were effectively zero from underneath or from above. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and s

[go-nuts] Re: `go test` does not honor -ldflags

2017-03-12 Thread marcus.low via golang-nuts
My apologies, I did not realise my work signature would automatically be added. -- -- *Grab is hiring. Learn more at **https://grab.careers * By

[go-nuts] json.Unmarshal and modifications to copies of structs

2017-03-12 Thread george.robinson via golang-nuts
Hello, Can someone explain to me how this prints "test world" twice? I had expected to see "test hello" and "test world". https://play.golang.org/p/E7CRQNE6oT Kind regards, -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

[go-nuts] Re: [ANN] fsq 1.4.0 released

2017-03-12 Thread rupcraft
Thanks for the input! By 'checking', I assume you mean check y.go into the git repository. I realize the motivation for this (go get), but since parser.y contains the actual change history (while y.go is generated), I tend to lean in favor of only versioning the yacc source. If fsq was meant to

[go-nuts] Call for Proposals: GORUCO 2017, NYC, June 24th

2017-03-12 Thread Mike Dalessio
Hey there, I'd like to ask y'all to consider submitting talk proposals to GORUCO 2017, which is a terrific regional software conference that I co-organize here in NYC. It may not be what you'd consider an obvious fit for gophers, but I assure you that talks about Go would be well received. Mor

[go-nuts] Help send women to Gophercon this year!

2017-03-12 Thread sadams . codes
Hey all, I've started a crowdfunding campaign to send women to Gophercon (gophercon.com) who can't afford to go. Please consider donating! Any amount appreciated. Please also forward to your employers. https://igg.me/at/Ei-kyYFu77k Women Who Go is part of a 501c3, so your employer may be able

Re: [go-nuts] Re: What happens when appending to a slice exceeds the backing capacity?

2017-03-12 Thread Jan Mercl
What is a reference to the array? To access the array use the slice itself as usual, no reflect needed. On Mon, Mar 13, 2017, 01:37 st ov wrote: > Thanks! > anyway to get a reference to that new array without using reflect? > > > > > On Sunday, March 12, 2017 at 12:13:03 PM UTC-7, Jan Mercl wrot

Re: [go-nuts] json.Unmarshal and modifications to copies of structs

2017-03-12 Thread Nigel Tao
On Mon, Mar 13, 2017 at 9:10 AM, george.robinson via golang-nuts wrote: > Can someone explain to me how this prints "test world" twice? I had expected > to see "test hello" and "test world". > > https://play.golang.org/p/E7CRQNE6oT m1 is not a pointer, but m1.S is a slice, and a slice is essentia

[go-nuts] thread safety of map when each goroutine access a different key

2017-03-12 Thread Albert Tedja
Hello, I know map itself isn't threadsafe, but I am just wondering how threadsafe it is if you can be absolutely sure that each goroutine accesses a different key in the map. Say, goroutine 1 accesses mymap["1"] and goroutine 2 accesses mymap["2"] and so on. Thank you in advance. -- You recei