Re: [go-nuts] strange behavior for type switch

2017-01-11 Thread Dan Kortschak
What are you trying to do? The behaviour of LimRange as you have it here is to return the float64 value of x if it is a float64, zero if it is another numerical type in the case list and NaN if it is none of those. I would suggest you read https://golang.org/ref/spec#Switch_statements 

[go-nuts] Re: Go mobile is not downloading on my OSX 10.12 system. What is going on?

2017-01-11 Thread Shyamal Chandra
The instruction found on google search don't know either. https://github.com/golang/go/issues/15484 On Wednesday, January 11, 2017 at 7:46:23 PM UTC-6, Shyamal Chandra wrote: > > Please answer these questions before submitting your issue. Thanks! > What version of Go are you using (go version)?

[go-nuts] Go mobile is not downloading on my OSX 10.12 system. What is going on?

2017-01-11 Thread Shyamal Chandra
Please answer these questions before submitting your issue. Thanks! What version of Go are you using (go version)? go version go1.7.4 darwin/amd64 What operating system and processor architecture are you using (go env)? Mac OSX 10.12.1 Sierra What did you do? I followed the instructions after

Re: [go-nuts] strange behavior for type switch

2017-01-11 Thread Dan Kortschak
On Wed, 2017-01-11 at 17:15 -0800, hui zhang wrote: >    switch v := x.(type) { >    case int,int8,int16,int32: What type is v here? It can't be any of the four types you have listed in the case since are not assignable to each other without conversion, so it must be an interface{}. interface{}

[go-nuts] Reading http directory

2017-01-11 Thread Nako Zeta
Is there any package to read http directories? For example to read an Apache index of /files/ I been doing this using goquery and parsing the HTML to know if its a folder or a file but I am looking for better alternatives -- You received this message because you are subscribed to the Google

Re: [go-nuts] encoding.BinaryMarshaler interface

2017-01-11 Thread Matt Harden
I would start with the naive implementation first, and only make it fancier (and more complicated) if that turns out not to be fast enough. Go's GC is pretty good already and getting better. You must not change the data in the returned slice after returning it, unless you somehow know that the

[go-nuts] encoding.BinaryMarshaler interface

2017-01-11 Thread hanisch
Suppose there's a struct, say Foo, that needs to be serialized and sent over the network very frequently (about every 100 microseconds to one millisecond, to a multicast group). To serialize Foo to write it to an io.Writer (e.g., a net.UDPConn), it would think it would be nice to have Foo

Re: [go-nuts] Simple(?) timer program behaves erratically on ARM (and playground), but totally fine on x86 Ubuntu

2017-01-11 Thread andrey mirtchovski
it would've been sufficient to print out "currDur" and see that it goes negative after a while On Wed, Jan 11, 2017 at 12:57 PM, Art Mellor wrote: > Thanks! I never would have found that. > > -- > You received this message because you are subscribed to the

[go-nuts] Simple(?) timer program behaves erratically on ARM (and playground), but totally fine on x86 Ubuntu

2017-01-11 Thread Art Mellor
The code below implements a simple timer loop that doubles the amount of time it waits (up to a max) after each firing. It works fine on my x86 linux box, but behaves erratically on a Raspberry Pi ARM platform (and on the playground). I'm assuming I'm doing something bad, but it isn't clear at

[go-nuts] Re: bit twiddling API survey

2017-01-11 Thread Damian Gryski
On Wednesday, January 11, 2017 at 12:38:35 AM UTC+1, not...@google.com wrote: > > Are bit rotations complied to single instructions? Specifically things > like: > > var a uint32 > (a << 5) | (a >> (32 - 5) > They will be (with 1.9) for constant rotate values:

[go-nuts] Re: clang: error: linker command failed with exit code 1 When building Go

2017-01-11 Thread malenchelonandrew
clang: *warning: *argument unused during compilation: '-pthread' ld: warning: directory not found for option '-L/opt/boost/lib' ld: warning: directory not found for option '-L/opt/local/lib/db48' ld: library not found for -lssl clang: *error: *linker command failed with exit code 1 (use -v

[go-nuts] Procs lines in Trace web viewer

2017-01-11 Thread Val
Hello trying to analyze and optimize the work load of my goroutines, I'm using the Trace web viewer and visualize the work of each of my processors :

[go-nuts] Resolving 'cannot find package' error with vendor in go 1.7

2017-01-11 Thread DM
I have a project structure which looks like below:- session-service _libs //Contains all the external dependencies ... // Other packages Content of _libs looks like below:- github.com golang.org x net gopkg.in My Makefile looks like below:- .PHONY: deploy LOGLEVEL ?= 1

Re: [go-nuts] image Gray16 endianness

2017-01-11 Thread Pablo Rozas Larraondo
Thanks again Dan, I enjoyed reading Rob Pike's blog post. I think you are right with your point, it has to be one way and not every machine use the same representation anyway. Cheers, Pablo On Wed, Jan 11, 2017 at 7:32 PM, Dan Kortschak < dan.kortsc...@adelaide.edu.au> wrote: > On Wed,

Re: [go-nuts] Re: Go 1.8 Release Candidate 1 is released

2017-01-11 Thread Michel Casabianca
Hello Gophers, I have updated my list of Go interfaces at: http://sweetohm.net/article/go-interfaces.en.html Enjoy! 2017-01-11 1:43 GMT+01:00 João Henrique Machado Silva : > Awesome! Thanks!! > > Em terça-feira, 10 de janeiro de 2017 18:38:03 UTC-2, Chris Broadfoot >

Re: [go-nuts] []struct{} vs. []*struct{}

2017-01-11 Thread Paul Jolly
This blog post by Russ Cox should help to explain the difference between a struct vs a pointer to a struct, and also the implementation of slices: https://research.swtch.com/godata There is not a single answer to the question on when to use a struct or a pointer to a struct, and not all answers

Re: [go-nuts] []struct{} vs. []*struct{}

2017-01-11 Thread 'chris dollin' via golang-nuts
On 11 January 2017 at 09:21, Henry wrote: > My understanding is that a slice is an array of pointers. No. A []T (slice of Ts) contains the length and capacity of the slice and a pointer to the backing array of the slice. The backing array is an array of elements of

[go-nuts] []struct{} vs. []*struct{}

2017-01-11 Thread Henry
My understanding is that a slice is an array of pointers. So your []struct{} is essentially an array of pointers to the structs. Your []*struct{} is an array of pointers to pointers to the structs. In terms of memory allocation, both should be similar. For every modification, a new array is

Re: [go-nuts] image Gray16 endianness

2017-01-11 Thread Dan Kortschak
On Wed, 2017-01-11 at 16:46 +1100, Pablo Rozas Larraondo wrote: > Thanks Dan. I'm just surprised that Gray16 uses big endian when, for > example, Go's uint16 type uses the little endian convention. On *most* supported architectures. > I guess I find this weird and I want to know if there is a