Re: [go-nuts] example in errors package documentation

2016-08-22 Thread Sam Whited
On Mon, Aug 22, 2016 at 8:29 AM, Sridhar wrote: > I suppose my question is where's the repo for the examples in the package > documentation ? >From the root of the main Go repo (which contains the standard library) look in src/errors/example_test.go —Sam --

[go-nuts] github project - https://github.com/Tfindelkind/automation - How to compile and install each package when using "go get github.com/Tfindelkind/automation"

2016-08-22 Thread tfindelkind
Hello, i am pretty new to this and struggling with the right folder structure. The project https://github.com/Tfindelkind/automation should provide a few executables which should be run on linux/windows/mac I created a folder for each executable with each has one main package.

[go-nuts] New Job Server in Go

2016-08-22 Thread Duo
Hello All, I've been working on a new small Job server in Go to scratch my own itch. It's called Workq. It's similar to Beanstalkd combined with a bit of Gearman for those who have used them. Take a look if this interests you: http://github.com/iamduo/workq. -- You received this message

[go-nuts] Re: vim-go and YCM

2016-08-22 Thread aleksandr . chirko
Had the same issue. What worked for me is https://github.com/Valloric/YouCompleteMe#ubuntu-linux-x64, run ' ./install.py --gocode-completer', and now enjoying real-time completion. On Wednesday, February 25, 2015 at 5:28:20 PM UTC+2, Sankar wrote: > > Hi > > I have installed

[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-22 Thread Volker Dobler
What would it be good for? Have you thought out all the implications? What is wrong with the current implementation which requires adding (* and ) . Combined by the good error message the compiler gives you. V. -- You received this message because you are subscribed to the Google Groups

[go-nuts] example in errors package documentation

2016-08-22 Thread Sridhar
The first example in the errors package documentation doesn't have anything to do with the errors package. How does one report this issue ? The golang/go issues has a Documentation label but that doesn't

[go-nuts] golang winodws installer source

2016-08-22 Thread Joe Blue
anyone know where the source is that the go team use to make their windows and OSX installers ? I figure i might be able to use it for my own apps. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

[go-nuts] Re: Understanding go routine heap

2016-08-22 Thread Joubin Houshyar
On Saturday, August 20, 2016 at 2:29:41 AM UTC-4, Yulrizka wrote: > > Dear gophers > > I have discussion with my colleague about this code > > > func process() *foo { > var result *foo > > var wg sync.WaitGroup > wg.Add(1) > go func() { > defer wg.Done() > result

[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-22 Thread T L
And why value of *I can't call methods of I? where I is an interface type. Looks there are many inconsistencies in golang. On Monday, August 22, 2016 at 10:04:31 PM UTC+8, T L wrote: > > . > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Bounds check elimination cases. Intended or compiler not clever enough

2016-08-22 Thread T L
just made some tests to check the new SSA BCE feature. It is cool by removing many unnecessary bounds checks. But I still found some cases where I think BCE should also be applied but not. I don't know if they are intended or not. // example4.go package main import "math/rand" func fa2() {

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

2016-08-22 Thread T L
. -- 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.com. For more options, visit https://groups.google.com/d/optout.

Re: [go-nuts] Re: Understanding go routine heap

2016-08-22 Thread Marvin Renich
* Joubin Houshyar [160822 09:47]: > > > On Saturday, August 20, 2016 at 2:29:41 AM UTC-4, Yulrizka wrote: > > func process() *foo { > > var result *foo > > > > var wg sync.WaitGroup > > wg.Add(1) > > go func() { > > defer wg.Done() > > result

[go-nuts] Re: Understanding go routine heap

2016-08-22 Thread T L
On Monday, August 22, 2016 at 9:47:03 PM UTC+8, Joubin Houshyar wrote: > > > > On Saturday, August 20, 2016 at 2:29:41 AM UTC-4, Yulrizka wrote: >> >> Dear gophers >> >> I have discussion with my colleague about this code >> >> >> func process() *foo { >> var result *foo >> >> var wg

[go-nuts] Working Example of runtime.SetCgoSymbolizer?

2016-08-22 Thread derek . buitenhuis
Quite excited by the prospects of easier debugging of CGO applications using runtime.SetCgoSymbolizer at work, since we must necessarily use CGO, and it's usually been rather painful to use a mix of delve, perf, and gdb to debug these programs. The documentation for this is rather (necessarily)

Re: [go-nuts] Re: Understanding go routine heap

2016-08-22 Thread Joubin Houshyar
On Monday, August 22, 2016 at 10:27:06 AM UTC-4, Marvin Renich wrote: > > * Joubin Houshyar [160822 09:47]: > > > > > > On Saturday, August 20, 2016 at 2:29:41 AM UTC-4, Yulrizka wrote: > > > func process() *foo { > > > var result *foo > > > > > > var wg

Re: [go-nuts] rune vs (single code-point) string - size and printing

2016-08-22 Thread Jakob Borg
2016-08-22 17:50 GMT+02:00 JC : > which will be stored in a slice of type byte (which will use just one uint8 > in this case). You're probably already aware of this, but just for clarity since the "size" thing is part of subject and there is a comparison to the

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

2016-08-22 Thread Manlio Perillo
Il giorno lunedì 22 agosto 2016 11:10:57 UTC+2, HWJ ha scritto: > > > Is there any documentation available on how to add support > for new architecture? > > I took a look at some files from `find src/cmd -iname "*amd64*"` > but didn't figure it out myself. > > See

[go-nuts] Golang upgrade from 1.5 to 1.7.2

2016-08-22 Thread Prateek Gaur
In order to use one of the go packages I updates my golang version from 1.5.2 to 1.7. But after update my go binaries seem to be segfaulting with following output : [1]19583 segmentation fault (core dumped) ./go/bin/ The core file gives following

Re: [go-nuts] Golang upgrade from 1.5 to 1.7.2

2016-08-22 Thread Ian Lance Taylor
On Mon, Aug 22, 2016 at 12:10 PM, Prateek Gaur wrote: > In order to use one of the go packages I updates my golang version from > 1.5.2 to 1.7. > > But after update my go binaries seem to be segfaulting with following output > : > [1]19583 segmentation fault (core dumped)

Re: [go-nuts] Why can't you take the address of a function's return value?

2016-08-22 Thread Peter Waller
On 22 August 2016 at 19:09, Jan Mercl <0xj...@gmail.com> wrote: > > Strictly speaking you can take the address of function's return value (eg. > https://play.golang.org/p/0PTrkWEirW). It's like taking the address of > any variable. But that's an lvalue, which () is not. > You just exploded my

[go-nuts] Re: rune vs (single code-point) string - size and printing

2016-08-22 Thread JC
Thank you all for the quick replies - they were very helpful. On Monday, 22 August 2016 17:28:59 UTC+1, adon...@google.com wrote: > > On Monday, 22 August 2016 11:51:59 UTC-4, JC wrote: >> >> Given: >> >> func main() { >> r := 'a' >> s := "a" >> fmt.Println(r) >> fmt.Println(s) >> } >> >> My very

[go-nuts] Build constraints exclude go:binary-only-package directive?

2016-08-22 Thread Joshua Liebow-Feeser
Hi All, According to the documentation , the //go:binary-only-package directive is only used when the file is "not excluded by build constraints." However, I have the following source: // +build !build_source //go:binary-only-package

Re: [go-nuts] how can I run a go program with arguments

2016-08-22 Thread Shawn Milochik
Try: go run myprog.go -- dummy.go -- 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.com. For more options, visit

Re: [go-nuts] Build constraints exclude go:binary-only-package directive?

2016-08-22 Thread Ian Lance Taylor
On Mon, Aug 22, 2016 at 2:57 PM, Joshua Liebow-Feeser wrote: > > According to the documentation, the //go:binary-only-package directive is > only used when the file is "not excluded by build constraints." However, I > have the following source: > > // +build !build_source > >

Re: [go-nuts] Generating x/sys/unix cross-platform

2016-08-22 Thread Ian Lance Taylor
On Mon, Aug 22, 2016 at 2:45 PM, wrote: > > A few months ago I asked about adding a new struct type to syscall. > (https://groups.google.com/d/msg/golang-nuts/5HTN3QVC_lQ/QuYxNl5UAgAJ) and I > got a great answer from Ian Lance Taylor that it would make sense to use the >

Re: [go-nuts] Generating x/sys/unix cross-platform

2016-08-22 Thread Elliot Morrison-Reed
Okay, I was running qemu behind a corporate proxy which is probably why the zsysnum update failed. I suppose the my best course of action could be just to cherry pick the generated differences that have to do with my additional structure, and leave everything else as is. Thanks for the Info. On

Re: [go-nuts] context: testing if an HTTP request was canceled

2016-08-22 Thread ymmt2005
I am experiencing the same problem, and the fix from Ian will resolve it. ymmt2005 2016年8月23日火曜日 3時08分26秒 UTC+9 Ian Lance Taylor: > > On Sun, Aug 21, 2016 at 9:53 AM, Manlio Perillo > wrote: > > I writing a simple HTTP client using the new context support in Go 1.7. >

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

2016-08-22 Thread Edward Muller
`go list -json std | jq` does not complain, which is my usual "is my json valid" test. On Sat, Aug 20, 2016 at 12:13 PM Lars Tørnes Hansen wrote: > I expected that > go list -json std > ... would output a valid JSON document, because > go help list > writes: > The -json flag

[go-nuts] Re: Golang upgrade from 1.5 to 1.7.2

2016-08-22 Thread Prateek Gaur
This is a weird interface. Looks like I can reply back only to my message. Anyway. I think your analysis is spot on Ian. All the binaries which depend on zookeeper are segfaulting whereas others are working fine. Zookeeper (zk.go) depends on cgo. I think our toolchain which has the built

[go-nuts] how can I run a go program with arguments

2016-08-22 Thread Xiao Liang
I try run this go run myprog.go dummy.go in this case. the second go file actually is the argument what I want to pass to myprog.go. but GO is going to load dummy.go and tring to run. If I build myprog as a execute file. it's work fine. Does anyone help? Thanks -- You received this message

[go-nuts] Generating x/sys/unix cross-platform

2016-08-22 Thread elliotmr
Hello Go-Nuts, A few months ago I asked about adding a new struct type to syscall. (https://groups.google.com/d/msg/golang-nuts/5HTN3QVC_lQ/QuYxNl5UAgAJ) and I got a great answer from Ian Lance Taylor that it would make sense to use the x/sys/unix library for my implementation. This worked

Re: [go-nuts] Build constraints exclude go:binary-only-package directive?

2016-08-22 Thread Joshua Liebow-Feeser
Done: https://github.com/golang/go/issues/16841 On Monday, August 22, 2016 at 3:19:48 PM UTC-7, Ian Lance Taylor wrote: > > On Mon, Aug 22, 2016 at 2:57 PM, Joshua Liebow-Feeser > wrote: > > > > According to the documentation, the //go:binary-only-package directive > is >

Re: [go-nuts] Generating x/sys/unix cross-platform

2016-08-22 Thread Aram Hăvărneanu
In general, the z files are generated on the target platforms; if you need to generate ppc64 files, you need a ppc64. They usually don't cross-generate, so to speak. However, by obtaining a cross-compiler, setting CC, and modifying the generation scripts, they can be generated on any host. After

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

2016-08-22 Thread Seb Binet
On Aug 22, 2016 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 > >

[go-nuts] how to resolve the warning about composite literal uses unkeyed fields .

2016-08-22 Thread tommy xiao
the go vet always report composite literal uses unkeyed fields warning, $ go vet `go list ./...|grep -v /vendor/` api/handlers.go:189: github.com/docker/swarm/cluster.ImageFilterOptions composite literal uses unkeyed fields exit status 1 scheduler/filter/dependency_test.go:60:

Re: [go-nuts] Correct way to dynamically run multiple http servers in the same application

2016-08-22 Thread Matt Harden
Instead of running the "env" command, you can simply loop through slice that os.Environ() returns. On Mon, Aug 22, 2016 at 6:35 PM wrote: > I'm trying to run any number of http reverse proxy servers listening on > different ports based on environment variables. The idea is

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

2016-08-22 Thread T L
On Tuesday, August 23, 2016 at 1:17:41 PM UTC+8, Jesse McNelis wrote: > > On Tue, Aug 23, 2016 at 3:11 PM, T L > wrote: > > If a programmer will call it anyway, she/he doesn't care efficiency. > What > > she/he cares is the convenience and cleanness. > > ppt.f() is

[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-22 Thread T L
On Tuesday, August 23, 2016 at 1:28:03 PM UTC+8, T L wrote: > > Looks this question can be stated as "why can't named pointer types have > methods?" > Just found this thread https://groups.google.com/forum/#!topic/golang-nuts/Vhh5XOm96YI to answer "why can't named pointer types have methods?"

Re: [go-nuts] Re: Golang upgrade from 1.5 to 1.7.2

2016-08-22 Thread Matt Harden
Consider using gozk , which doesn't require cgo. On Mon, Aug 22, 2016 at 4:29 PM Prateek Gaur wrote: > This is a weird interface. Looks like I can reply back only to my message. > Anyway. > > I think your analysis is spot on

[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-22 Thread T L
On Tuesday, August 23, 2016 at 9:07:21 AM UTC+8, Dave Cheney wrote: > > Because **T and *T are different types. *T and T are also different types. What treat **T and *T differently? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[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-22 Thread T L
Looks this question can be stated as "why can't named pointer types have methods?" package main type PT *int func (pt PT) f() {} // error: invalid receiver type PT (PT is a pointer type) func main() {} On Monday, August 22, 2016 at 10:04:31 PM UTC+8, T L wrote: > > . > -- You received this

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

2016-08-22 Thread Jesse McNelis
> Why a **T value can't call methods of *T and T if a *T value can call methods > of T? How many levels of auto dereferencing should there be? Should *T still have the same method set as *T? It's reasonable to set a sensible limit because pointer chasing is an expensive operation.

[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-22 Thread Volker Dobler
Am Dienstag, 23. August 2016 04:58:31 UTC+2 schrieb T L: > > > > On Monday, August 22, 2016 at 11:28:54 PM UTC+8, Volker Dobler wrote: >> >> Because pointers to interface are almost never needed. So why complicate >> the language for the sake of consistency nobody will ever notice >> during the

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

2016-08-22 Thread Jesse McNelis
On Tue, Aug 23, 2016 at 3:11 PM, T L wrote: > If a programmer will call it anyway, she/he doesn't care efficiency. What > she/he cares is the convenience and cleanness. > ppt.f() is surely cleaner than (*ppt).f(), right? > It shouldn't be convenient or look clean

Re: [go-nuts] Working Example of runtime.SetCgoSymbolizer?

2016-08-22 Thread Ian Lance Taylor
On Mon, Aug 22, 2016 at 10:29 AM, Ian Lance Taylor wrote: > On Mon, Aug 22, 2016 at 9:27 AM, wrote: >> Quite excited by the prospects of easier debugging of CGO applications using >> runtime.SetCgoSymbolizer at work, >> since we must necessarily use

Re: [go-nuts] Working Example of runtime.SetCgoSymbolizer?

2016-08-22 Thread Ian Lance Taylor
On Mon, Aug 22, 2016 at 9:27 AM, wrote: > Quite excited by the prospects of easier debugging of CGO applications using > runtime.SetCgoSymbolizer at work, > since we must necessarily use CGO, and it's usually been rather painful to > use a mix of delve, perf, and gdb

[go-nuts] Re: golang winodws installer source

2016-08-22 Thread mhhcbon
there it is https://github.com/golang/build/blob/master/cmd/release/releaselet.go#L495 -- 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] Re: Understanding go routine heap

2016-08-22 Thread Marvin Renich
* Joubin Houshyar [160822 12:36]: > On Monday, August 22, 2016 at 10:27:06 AM UTC-4, Marvin Renich wrote: > > * Joubin Houshyar [160822 09:47]: > > > > > > Your firend is correct that using a WaitGroup here does not in anyway > > > address concurrent

Re: [go-nuts] Working Example of runtime.SetCgoSymbolizer?

2016-08-22 Thread Derek Buitenhuis
On 8/22/2016 6:32 PM, Ian Lance Taylor wrote: > Oh, whoops, I had an uncommitted change to my cgosymbolizer sources. > I just committed it. You should `go get -u > github.com/ianlancetaylor/cgosymbolizer`, after which I hope things > will work better. Indeed that did! The only difference now is

Re: [go-nuts] Working Example of runtime.SetCgoSymbolizer?

2016-08-22 Thread Derek Buitenhuis
On 8/22/2016 6:29 PM, Ian Lance Taylor wrote: > What do you see when you run your program? This is what I see, and it > is what I expect; note that "crash.c:5" line. Do you see something > different? If this is what you see, how does it differ from what you > expect? What you have attached is

[go-nuts] Couldn't build any .go.

2016-08-22 Thread 95livc
go build xxx.go I get : go build command-line-arguments: /usr/lib/golang/pkg/tool/linux_386/compile: signal: trace/breakpoint trap How to fix it?? CentOS go version go1.5.1 linux/386 THX. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Re: check if host is reachable

2016-08-22 Thread justinpcuga
You can always call the OS's ping command from within go. This isn't too terrible. You can see a cross-platform example here: https://github.com/jcuga/goping On Saturday, August 10, 2013 at 2:55:31 AM UTC-4, will wrote: > > Hi everyone, > > I am a newbie to golang and loving it. > > Is there

Re: [go-nuts] context: testing if an HTTP request was canceled

2016-08-22 Thread Ian Lance Taylor
On Sun, Aug 21, 2016 at 9:53 AM, Manlio Perillo wrote: > I writing a simple HTTP client using the new context support in Go 1.7. > I need to test it in case a timeout is specified and expires, but I'm having > problems. > > The context package defines the Cancel error

Re: [go-nuts] Why can't you take the address of a function's return value?

2016-08-22 Thread Ian Lance Taylor
On Mon, Aug 22, 2016 at 9:40 AM, wrote: > > I've been using a typedef of > > type MaybeTimestamp *int64 > > so we can JSON encode timestamps correctly, see > https://medium.com/coding-and-deploying-in-the-cloud/time-stamps-in-golang-abcaf581b72f > for inspriation > > I

Re: [go-nuts] Why can't you take the address of a function's return value?

2016-08-22 Thread Jan Mercl
On Mon, Aug 22, 2016, 19:24 wrote: > Hey All, > > I've been using a typedef of > > type MaybeTimestamp *int64 > > so we can JSON encode timestamps correctly, see > https://medium.com/coding-and-deploying-in-the-cloud/time-stamps-in-golang-abcaf581b72f > for inspriation

Re: [go-nuts] how to resolve the warning about composite literal uses unkeyed fields .

2016-08-22 Thread Matt Harden
cluster.ImageFilterOptions has an embedded field of type types.ImageListOptions. When fields are embedded, the field name is set to the type. So you can write: groupImages := make(map[string]apitypes.Image) opts := cluster.ImageFilterOptions{ ImageListOptions: apitypes.ImageListOptions{ All:

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

2016-08-22 Thread Seb Binet
On Mon, Aug 15, 2016 at 11:40 PM, Rob Pike wrote: > Sounds a lot like the Newsqueak implementation. https://swtch. > com/~rsc/thread/newsquimpl.pdf > quite. although, Lars' idea to target D or Julia would make the interpreter non go-get-able. actually, I've just watched your

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

2016-08-22 Thread Aram Hăvărneanu
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 toolchain, and have a vm interpret this? Everything