[go-nuts] Cross compiled binary caches goroot?

2017-10-15 Thread Nate Finch
https://github.com/magefile/mage/issues/69 Mage calls go build via os/exec, explicitly passing through os.Environ to the subprocess. Somehow the cross compiled binary from my osx laptop is referencing the goroot from my laptop when it tries to run go build on a Linux machine. 1. How is

[go-nuts] Re: [ANN] Frame - Plan9 libframe in Go

2017-10-15 Thread as
I tested it with another font, and it definitely doesn't handle it. I'll have to fix that. https://github.com/as/frame/issues/26 On Tuesday, October 10, 2017 at 8:30:22 PM UTC-7, as wrote: > > For those of you who miss the Plan9 editable text boxes, here's a Go > package that approximates

Re: [go-nuts] access runtime implemented functions

2017-10-15 Thread Jesper Louis Andersen
The short answer: you can't, and it is a feature. The runtime "injects" certain functions into certain packages in order to build a bridge between the (internal) runtime and the "package world" accessible to programmers. Thus, they are only accessible in that package specific package (time). The

[go-nuts] Re: How to learn golang web development

2017-10-15 Thread Christoph Berger
"Learn to Create Web Applications using Go" offers both a course and a book about the topic. I have the book and love it, and the course also looks impressive from what I can see on the landing page. On Thursday, October 12, 2017 at 3:39:32 PM UTC+2, snakes wrote: >

[go-nuts] Cross compiled binary caches goroot?

2017-10-15 Thread Nate Finch
I cross compiled using go 1.9 if it matters. -- 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] Is iota increment behavior implemented here?

2017-10-15 Thread Jan Mercl
On Sun, Oct 15, 2017 at 8:59 PM wrote: > I'm writing an article about iota and I've found that its counting behavior is implemented in the below source code? Am I right, if not, where it is? Can you help me? > >

Re: [go-nuts] Re: concurrent write-only to map ok?

2017-10-15 Thread Alex Buchanan
Show me the code! :) Here's mine: https://play.golang.org/p/ZwAlu5VuYr -- 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.

[go-nuts] Is iota increment behavior implemented here?

2017-10-15 Thread m
Hi, I'm writing an article about iota and I've found that its counting behavior is implemented in the below source code? Am I right, if not, where it is? Can you help me? https://github.com/golang/go/blob/90d71fe99e21b68e292327c966946f1706d66514/src/cmd/compile/internal/gc/noder.go#L263

[go-nuts] Re: Task scheduler as a library?

2017-10-15 Thread Jimmy Tang
Not to throw a spanner into the works, but we have a similar problem in my work environment of needing a scheduler to schedule distributed jobs, one problem of writing a *nice* one for a given language is that you end up being pigeon holed into one solution. We've been looking at using drmaa as

Re: [go-nuts] Re: Ternary operator needed in Go

2017-10-15 Thread matti . dahlbom
In addition (or instead of) the ternary operator; I would very much like to see an operator like: Python's OR for selecting a non-None value: foo = bar or baz Swift's ?? operator for using a value if non-nil or otherwise another value: foo = bar ?? "default" -- You received this message

Re: [go-nuts] access runtime implemented functions

2017-10-15 Thread traetox
Jesper, First off, thank you for the detailed answer, I very much appreciate you taking the time to provide the background information. I had not internalized how closely tied to the runtime the standard library is. For this instance, I require extremely performant access to the underlying

Re: [go-nuts] Cross compiled binary caches goroot?

2017-10-15 Thread Ian Lance Taylor
On Sun, Oct 15, 2017 at 5:22 AM, Nate Finch wrote: > https://github.com/magefile/mage/issues/69 > > Mage calls go build via os/exec, explicitly passing through os.Environ to > the subprocess. > > Somehow the cross compiled binary from my osx laptop is referencing the >

Re: [go-nuts] Is iota increment behavior implemented here?

2017-10-15 Thread roger peppe
Yes, that looks about right (the actual count increment is done on line 316). On 15 October 2017 at 14:52, wrote: > Hi, > > I'm writing an article about iota and I've found that its counting behavior > is implemented in the below source code? Am I right, if not, where it is? >

[go-nuts] Re: Cross compiled binary caches goroot?

2017-10-15 Thread Nate Finch
hmm... I really don't want people to have to build Mage, since mage is a build tool. Would it be horrible to just run go env GOROOT and use that to set GOROOT in the environs for the command that runs go build? On Sunday, October 15, 2017 at 5:36:43 PM UTC-4, Dave Cheney wrote: > > My guess

[go-nuts] Cross compiled binary caches goroot?

2017-10-15 Thread Dave Cheney
My guess is that GOROOT is not set in the target environment so the value eventually collapses back on the GOROOT compiled into mage from the value compiled into the toolchain that built mage. gb has the same problem, I didn’t want to encourage people to set GOROOT, but if they don’t, there

[go-nuts] [ANN] gopig

2017-10-15 Thread bnixon67
Here's an implementation of the "pig" dice game that I wrote in go to learn the language. Nothing exciting, but I thought others who are just starting might be interested. https://github.com/bnixon67/gopig -- You received this message because you are subscribed to the Google Groups

[go-nuts] How to pass a value to multiple readers of a shared channel

2017-10-15 Thread st ov
A value sent through a channel can be read by only one reader, so once its read its no longer available to other readers is that right? In what ways can I pass/communicate/distribute a value through a channel and have it shared across an unknown number of readers? -- You received this message

[go-nuts] Re: How to pass a value to multiple readers of a shared channel

2017-10-15 Thread djadala
And here is some working code: https://play.golang.org/p/1Qt-LqKiph Djadala On Sunday, October 15, 2017 at 11:36:36 PM UTC+3, st ov wrote: > > A value sent through a channel can be read by only one reader, so once its > read its no longer available to other readers is that right? > > In what

Re: [go-nuts] Re: Ternary operator needed in Go

2017-10-15 Thread Ian Lance Taylor
On Sat, Oct 14, 2017 at 11:50 PM, wrote: > > In addition (or instead of) the ternary operator; I would very much like to > see an operator like: > > Python's OR for selecting a non-None value: > > foo = bar or baz > > Swift's ?? operator for using a value if non-nil or

Re: [go-nuts] Cross compiled binary caches goroot?

2017-10-15 Thread Nate Finch
I'm not cross compiling the tool chain. I'm cross compiling a binary(Mage) that just calls os/exec with "go", "build" and passes through os.Environ I'll see if I can repro with a minimal example tonight. -- You received this message because you are subscribed to the Google Groups

[go-nuts] Re: Cross compiled binary caches goroot?

2017-10-15 Thread Dave Cheney
Thank should work. On Monday, 16 October 2017 10:30:45 UTC+11, Nate Finch wrote: > > hmm... I really don't want people to have to build Mage, since mage is a > build tool. Would it be horrible to just run go env GOROOT and use that > to set GOROOT in the environs for the command that runs go

[go-nuts] Re: Task scheduler as a library?

2017-10-15 Thread Alex Buchanan
Not a spanner at all. I think the Task Execution Schemas (TES) [1], which Funnel is based on, is a reinvention of DRMAA using technologies such as HTTP, REST, JSON, Protobuf. It's a pretty simple API and message type (Task) for create, get, list, cancel. But, admittedly, I don't know enough

[go-nuts] Iota with string constants

2017-10-15 Thread m
Is it anything wrong just assigning string values to get rid of String() method attaching? *Like this:* type Weekday string const ( Sunday Weekday = "Sunday" Monday Weekday = "Monday" ) func main() { fmt.Println(Sunday) } *Instead of this:* type weekday uint const ( Sunday

Re: [go-nuts] Is iota increment behavior implemented here?

2017-10-15 Thread m
Great, thanks! On Sunday, October 15, 2017 at 11:09:08 PM UTC+3, rog wrote: > > Yes, that looks about right (the actual count increment is done on line > 316). > > On 15 October 2017 at 14:52, wrote: > > Hi, > > > > I'm writing an article about iota and I've found that its

[go-nuts] Re: How to pass a value to multiple readers of a shared channel

2017-10-15 Thread djadala
This post might help: https://rogpeppe.wordpress.com/2009/12/01/concurrent-idioms-1-broadcasting-values-in-go-with-linked-channels/ Djadala On Sunday, October 15, 2017 at 11:36:36 PM UTC+3, st ov wrote: > > A value sent through a channel can be read by only one reader, so once its > read its no

[go-nuts] Re: [ANN] gopig

2017-10-15 Thread Pablo Rozas Larraondo
Thanks for sharing. You might be interested in this nice implementation of the same game implemented by the Go team a few years ago. It contains a great demonstration of hoe to solve this problem elegantly using functions as returned values: https://golang.org/doc%2Fcodewalk%2Fpig.go Cheers,

[go-nuts] Re: Cross compiled binary caches goroot?

2017-10-15 Thread Nate Finch
Reporting back: this worked perfectly. On Sunday, October 15, 2017 at 7:43:47 PM UTC-4, Dave Cheney wrote: > > Thank should work. > > On Monday, 16 October 2017 10:30:45 UTC+11, Nate Finch wrote: >> >> hmm... I really don't want people to have to build Mage, since mage is a >> build tool. Would

[go-nuts] Re: gomobile bind doesn't work for socket.

2017-10-15 Thread dummyedu
I add a simple test case. // +build linux darwin freebsd package kcpgousage import ( "log" kcp "github.com/xtaci/kcp-go" ) func Test() { log.Printf("KCP SNMP:%+v", kcp.DefaultSnmp.Copy()) } go bind this file will have similor errors. 在 2017年10月16日星期一 UTC+8上午11:45:18,dumm...@gmail.com写道: >

Re: [go-nuts] param represents a bit in struct?

2017-10-15 Thread Ian Lance Taylor
On Sun, Oct 15, 2017 at 8:50 PM, sheepbao wrote: > > is golang has any like this represents a bit in struct in c language : Not directly, no. You can of course do it using a uint8 and the operators | & &^. Ian -- You received this message because you are subscribed to

[go-nuts] Re: param represents a bit in struct?

2017-10-15 Thread Dave Cheney
Sorry, Go does not support C's bitfields On Monday, 16 October 2017 14:50:48 UTC+11, sheepbao wrote: > > is golang has any like this represents a bit in struct in c language : > > > struct tcphdr { > uint16_t sport; > uint16_t dport; > uint32_t seq; > uint32_t ack_seq; > uint8_t rsvd : 4; >

[go-nuts] param represents a bit in struct?

2017-10-15 Thread sheepbao
is golang has any like this represents a bit in struct in c language : struct tcphdr { uint16_t sport; uint16_t dport; uint32_t seq; uint32_t ack_seq; uint8_t rsvd : 4; uint8_t hl : 4; uint8_t fin : 1, syn : 1, rst : 1, psh : 1, ack : 1, urg : 1, ece : 1, cwr : 1; uint16_t win; uint16_t csum;

[go-nuts] gomobile bind doesn't work for socket.

2017-10-15 Thread dummyedu
I want to use a go library( https://github.com/xtaci/kcp-go ) and compile it on ios platform. The library itself can't be totally exported because go-mobile type limitation. I write a custom package to use the library and export function to be used in ios platform. But gomobile bind give

[go-nuts] Re: How to pass a value to multiple readers of a shared channel

2017-10-15 Thread wolf0403
My feeling is that a variable paired with a sync.Cond might be the right choice if you are broadcasting a single value change. I can't think of an readily available lib / language feature to support broadcasting multiple value change though. On Monday, 16 October 2017 06:36:36 UTC+10, st ov

Re: [go-nuts] Re: param represents a bit in struct?

2017-10-15 Thread Rob Pike
C shouldn't support bitfields either, but that's off-topic. -rob On Mon, Oct 16, 2017 at 3:14 PM, Dave Cheney wrote: > Sorry, Go does not support C's bitfields > > > On Monday, 16 October 2017 14:50:48 UTC+11, sheepbao wrote: >> >> is golang has any like this represents a bit