[go-nuts] Re: Testing "internal" packages?

2016-12-21 Thread Vaidotas Sm
OK, so I have a project named golang_web_boilerplate in $GOPATH/src: *> go test ./...* # golang_web_boilerplate/db/migrations runtime.main: call to external function main.main runtime.main: main.main: not defined runtime.main: undefined: main.main ? golang_web_boilerplate [no test files]

[go-nuts] Re: Testing "internal" packages?

2016-12-21 Thread Dave Cheney
I'd bet that something is wrong with your go install. Double check you have not set goroot, then delete your go install and start again from scratch. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiv

[go-nuts] Re: Testing "internal" packages?

2016-12-21 Thread Dave Cheney
I'd bet that something is wrong with your go install. Double check you have not set goroot, then delete your go install and start again from scratch. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiv

[go-nuts] Golang periodically executing a go routine

2016-12-21 Thread DM
I am trying write a small golang program which will periodically execute lsof -i: to check number of open TCP connections at a port. Code looks like below:- package main import ( "fmt" "log" "os/exec" "strings" "sync" "time" ) type Lsof struct { Command string

Re: [go-nuts] Golang periodically executing a go routine

2016-12-21 Thread 'Axel Wagner' via golang-nuts
You need to pass the WaitGroup as a pointer. This way, connectionsCount creates a WaitGroup, increments it's counts, passes a copy of it to count and then waits on the original; count, however, only Done()s its copy. go vet should probably complain about that, as it contains an appropriate marker

[go-nuts] Re: howto: compile template against well-known structure ?

2016-12-21 Thread Egon
On Tuesday, 20 December 2016 19:26:35 UTC+2, mhh...@gmail.com wrote: > > oh i see now. Indeed. Awesome and neat. > PS: forgot to mention, this can be mixed with templating as well. A declaration for some particular widget might be var Button = ui.Template{"button.html"} Button.RenderCustom(map[

[go-nuts] golang.org/x/tools/godoc/vfs on Windows

2016-12-21 Thread lyolik1977
Hello, Is there a way to set up a vfs.NameSpace filesystem backed up by Windows filesystem without specific root, something like: ns.Open("C:\\foo\\bar") => content of C:\foo\bar ns.Open("D:\\qux") => content of D:\qux and so on. Why do I need it? Imagine a local file system backed by in-memor

[go-nuts] Re: Testing "internal" packages?

2016-12-21 Thread vaidotas . smalskys
So what I find out was that I was using Goose Database migrations in Go code form (and so runtime.main warnings) - so tests were not run. If I remove migration code, everything works. Will investigate this more later today. -- You received this message because you are subscribed to the Google

[go-nuts] Re: 'Undefined symbols for architecture x86_64'

2016-12-21 Thread alexandru . sfirlogea
I just want to add that for mac/osx/darwin, in order to use an external framework with cgo and avoid this error you can do the following: package main // To import the CoreGraphics.framework import ( // #cgo LDFLAGS: -framework CoreGraphics // #include "C" // other packages... )

[go-nuts] Kafka with "At least once" for message delivery guarantees

2016-12-21 Thread Jérôme LAFORGE
Hello all, I am looking for feedback about Kafka consumer driver, that can allow "*At least once*" for message delivery guarantees (as described here https://kafka.apache.org/documentation/#semantics). Currently, from my point of view the only driver can manage this, it is https://godoc.org/gith

[go-nuts] redundant type specifiers

2016-12-21 Thread Steve Roth
The survey that was recently posted here asked, among other things, what changes to the language would be most useful. The one that immediately came to my mind was getting rid of the need for redundant type specifiers (examples below). It occurred to me that this must have been discussed befo

[go-nuts] Json-ifying map[bson.ObjectId] is not as expected

2016-12-21 Thread Vincent Jouglard
Hi, I am sending a map of elements indexed by a bson.ObjecId(), coming from the bdd. type Stats struct { A bson.ObjectId `json:"a,omitempty" bson:"a,omitempty"` B map[bson.ObjectId]CustomType `json:"b,omitempty" bson:"b,omitempty"` } // t is of type Stats if err = c.Write

Re: [go-nuts] redundant type specifiers

2016-12-21 Thread Rob Pike
Not only was it discussed, it was tried, maybe in the run-up to Go 1. It was a while ago, anyway. But we found it made code harder to understand and brittle when you have lots of fields, so the change was not rolled out. As is often the case, what looks good for simple examples breaks down in the

[go-nuts] Re: howto: compile template against well-known structure ?

2016-12-21 Thread mhhcbon
Hi, back on my initial question about compiling template, i m looking for some experienced ideas. I have now found out i needed to change the ast tree of template in order to simplify it for later manipulation. So for example i transform this {{ ("what" | up) | lower }} into {{ $some := ("what

[go-nuts] Re: Json-ifying map[bson.ObjectId] is not as expected

2016-12-21 Thread Jon Calhoun
The first bson.ObjectID that you show isn't actually what is stored in the object, but rather it is hex value of the object ID that is acquired by calling id.Hex() It looks like that isn't what gets printed out when marshaling your map, and instead the IDs are printed out as whatever the raw

Re: [go-nuts] CFG for a Go program

2016-12-21 Thread akshanshchahal
Ok, thank you. I will try. On Tuesday, December 20, 2016 at 8:50:39 PM UTC+5:30, Alan Donovan wrote: > > On 20 December 2016 at 10:07, > wrote: > >> You mentioned it will be easier to use gc compiler's SSA representation. >> By what commands can I get that SSA representation and is there any >>

Re: [go-nuts] bug report?: go font box drawing is wrong

2016-12-21 Thread Nigel Tao
On Mon, Nov 28, 2016 at 5:28 PM, wrote: > The ascenders for blocks, lines, etc are all wrong and it's very > distracting. I'm enjoying go mono in the terminal so far but it's tedious to > go through every file and delete the problematic character ranges. Can these > be removed from the font until

[go-nuts] TCP DialTimeout Not Working Stuck for Hours.

2016-12-21 Thread kumargv
Hi, I was trying to connect with DialTimeout as: address:= "127.0.0.1:5" address:= "127.0.0.1:7432" conn, err := net.DialTimeout("tcp", address, time.Duration(30)*time.Second) if err != nil { fmt.Println("error in conn : ",err) return nil, err } My program Stuck in Net.DialTimeout I am n

[go-nuts] Re: howto: compile template against well-known structure ?

2016-12-21 Thread Egon
On Wednesday, 21 December 2016 23:34:54 UTC+2, mhh...@gmail.com wrote: > > Hi, > > back on my initial question about compiling template, i m looking for some > experienced ideas. > > I have now found out i needed to change the ast tree of template in order > to simplify it for later manipulatio

[go-nuts] TCP DialTimeout Not Working Stuck for Hours.

2016-12-21 Thread Dave Cheney
Can you please give a few more details. Which version of Go, which operating system, that kind of thing. -- 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-n

[go-nuts] Re: TCP DialTimeout Not Working Stuck for Hours.

2016-12-21 Thread kumargv
GO 1.7 centos 7.2.1511 On Thursday, December 22, 2016 at 12:35:44 PM UTC+5:30, Dave Cheney wrote: > > Can you please give a few more details. Which version of Go, which > operating system, that kind of thing. -- You received this message because you are subscribed to the Google Groups "golang

[go-nuts] Re: TCP DialTimeout Not Working Stuck for Hours.

2016-12-21 Thread Dave Cheney
Thanks for confirming, I had thought it was the usual windows anti virus issues, but that is not applicable if you are running linux. Can you please provide a small runnable code sample that demonstrates the problem. On Thursday, 22 December 2016 18:13:14 UTC+11, kumargv wrote: > > GO 1.7 > ce