[go-nuts] What's the -buildid for?

2016-12-18 Thread scauyjf
When I run go build -x, I find that there is -buildid flag in the compile and link command. What is it for? -- 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

[go-nuts] Re: Assign a new value to an already initiated variable in template

2016-12-18 Thread Aliaksandr Valialkin
FYI, complex logic may be easily implemented with alternative template engines like https://github.com/valyala/quicktemplate . -- 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,

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

2016-12-18 Thread Aliaksandr Valialkin
Take a look at https://github.com/valyala/quicktemplate . Though it is incompatible with template/html sytax, it provides static template compilation, high performance and go-like syntax. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Timing works fine against a single host, but when probing hosts concurrently the timing is wrong

2016-12-18 Thread ltjbour
Bsically I'm writing an application that traceroutes a given set of hosts concurrently. I got the logic pretty much done but I'm having a slight problem with the timings. I am measuring the round-trip-times (rtt) of each packet with classic method of defining a `begin := time.Now()` variable

Re: [go-nuts] x/crypto/ssh server question

2016-12-18 Thread Mark Adams
Hi Andrew! Take a quick look at the signature for ServerConfig.PublicKeyCallback : PublicKeyCallback func(conn ConnMetadata, key PublicKey) (*Permissions, > error) As you already know, PublicKeyCallback allows you to indicate whether or

Re: [go-nuts] Channels of multiple values

2016-12-18 Thread slav . isv
I know this is an old post, just thought to share possible work around. Idea is basically return a func that will return multiple values. I'm not sure how much performance overhead this will create and it's a little bit ugly, but works as intended. func f(c chan func() (int, string)) { c <-

[go-nuts] Re: Assign a new value to an already initiated variable in template

2016-12-18 Thread ldeng via golang-nuts
encountered same problem, as it seems still an open issue, cannot change value of an existing variable inside of loop/if in template https://github.com/golang/go/issues/10608 ... {{$deprecated := false}} {{range $depre_audit := $depre_audits}} {{if eq $audit_name $depre_audit}}

Re: [go-nuts] Packaging Test Utilities in a Project

2016-12-18 Thread Marian Kopriva
What Dave suggested should work, in your example package1, package2, package3 and package4 should be able to import testhelpers with `import "project/internal/testhelpers"` On Sunday, December 18, 2016 at 2:48:41 PM UTC+1, Henry wrote: > > Where do you put this internal package in relation to

Re: [go-nuts] package containing standard CA roots?

2016-12-18 Thread Konstantin Khomoutov
On Sat, 17 Dec 2016 10:41:33 -0800 (PST) Rick wrote: > Alpine is a lightweight option with official Docker images. You can > install the CERTS using the Alpine package manager: > > # apk --no-cache add ca-certificates && update-ca-certificates All-in-all,

[go-nuts] gomobile: support/v7/app vs app

2016-12-18 Thread andrey mirtchovski
The main activity in the reverse example uses a support/v7/app.AppCompatActivity (as it should), however if I want to add an app.Service service to the android app gomobile encounters duplicate import errors: gomobile_bind/go_appmain.go:20: app redeclared as imported package name If I attempt

[go-nuts] Re: write barrier and C types

2016-12-18 Thread Tamás Gulácsi
2016. december 18., vasárnap 20:13:39 UTC+1 időpontban Florian Uekermann a következőt írta: > > Well, I am pretty sure I was wrong about something. Turning of the garbage > collector results in no error. Any smart ideas for debugging this? > > As I know, that means that indeed your analysis is

[go-nuts] Re: gomobile: Intent.setClassName(String, String) called from Go?

2016-12-18 Thread andrey mirtchovski
Nevermind, found the missing piece with a bit more documentation-reading: SetClassName_Ljava_lang_String_2Ljava_lang_String_2 -- 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,

[go-nuts] Download all dependencies using go get ./...

2016-12-18 Thread Peng Wang
I have a project that using golang.org/x/crypto/ssh, when I try to build it, i usually do a go get ./... command(since it's easy to remember for every project and shorter than go get golang.org/x/crypto/ssh), but then it reports cannot find package "golang.org/x/net/context/ctxhttp". It seems

[go-nuts] gomobile: Intent.setClassName(String, String) called from Go?

2016-12-18 Thread andrey mirtchovski
I'm trying to create a long-running service from Go by calling startService with an intent. I can't see how to create an intent with a Class from Go, so I want to do the second best thing, use setClassName*: intent := Intent.New() intent.SetClassName("package", "service")

Re: [go-nuts] Packaging Test Utilities in a Project

2016-12-18 Thread Henry
The problem with putting my test utilities under a single file, lets say util_test.go, is that the utilities are not usable across different packages within the same project. As far as I know, you cannot import test packages (eg. mypackage_test). -- You received this message because you are

[go-nuts] Re: programming embedded systems with Go

2016-12-18 Thread Manlio Perillo
Il giorno domenica 18 dicembre 2016 23:14:24 UTC+1, Manlio Perillo ha scritto: > > I would like to start playing with some cheap boards with Linux or OpenWRT. > With the recent support for mips32, what are the current available choices > that are able to run a Go program without problems? > >

[go-nuts] programming embedded systems with Go

2016-12-18 Thread Manlio Perillo
I would like to start playing with some cheap boards with Linux or OpenWRT. With the recent support for mips32, what are the current available choices that are able to run a Go program without problems? Currently the Go wiki has only a page about ARM support. Thanks Manlio -- You received

Re: [go-nuts] Packaging Test Utilities in a Project

2016-12-18 Thread Mark Mandel
Any reason not to have a `utils_test.go` file - and puts your utilities in there? Seems like the simplest solution. Then they only get included for your tests. Using /internal for testing tools feels a bit strange to me IMHO. Mark On 18 December 2016 at 11:13, Matt Harden

Re: [go-nuts] package containing standard CA roots?

2016-12-18 Thread Lars Seipel
On Thu, Dec 15, 2016 at 04:35:09PM +, Alex Flint wrote: > Does anyone know of a golang package that embeds (go-bindata or similar) a > reasonable standard set of CA roots? No, but the common approach is to rely on the root CA set maintained by Mozilla. This should correspond to the latest

[go-nuts] Re: write barrier and C types

2016-12-18 Thread 'Florian Uekermann' via golang-nuts
Well, I am pretty sure I was wrong about something. Turning of the garbage collector results in no error. Any smart ideas for debugging this? On Sunday, December 18, 2016 at 4:20:25 PM UTC+1, Florian Uekermann wrote: > > I may be misdiagnosing the problem, but I think go is doing a problematic

Re: [go-nuts] Packaging Test Utilities in a Project

2016-12-18 Thread Matt Harden
An import of a path containing the element “internal” is disallowed if the importing code is outside the tree rooted at the parent of the “internal” directory. Note the use of the word "tree" in that sentence, as opposed to "directory". On Sun, Dec 18, 2016 at 5:48 AM Henry

Re: [go-nuts] Golang for ARM

2016-12-18 Thread Paulo Coutinho
But i set it, You can see on dockerfile. ENV GO_VERSION=1.7.4 ENV INSTALLED_GOLANG=1.6 ENV GOROOT_BOOTSTRAP=/usr/lib/go-${INSTALLED_GOLANG} ENV GOOS=android ENV GOARCH=arm ENV GOARM=7 ENV CGO_ENABLED=1 Em 18 de dez de 2016 7:25 AM, "Will Newton" escreveu: > On Sun,

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

2016-12-18 Thread 'Alan Donovan' via golang-nuts
On 17 December 2016 at 23:54, wrote: > For each instruction in any BasicBlock I want to know the type of > instruction, the variables used in that instruction. [...] Just one line > of the program corresponds to multiple instructions. Is there some > documentation as

[go-nuts] Re: write barrier and C types

2016-12-18 Thread 'Florian Uekermann' via golang-nuts
I forgot to ask another question. If solving this is not practical in go, should I bring this up with the Vulkan people? I don't really understand why they don't use uint64_t regardless of architecture. -- You received this message because you are subscribed to the Google Groups "golang-nuts"

[go-nuts] write barrier and C types

2016-12-18 Thread 'Florian Uekermann' via golang-nuts
I may be misdiagnosing the problem, but I think go is doing a problematic check of the value of C pointer types pointers. The following runtime error is reproducible, but does not always happen in a program: runtime: writebarrierptr *0xc420326a90 = 0x12 fatal error: bad pointer in write

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

2016-12-18 Thread mhhcbon
static escaping == great idea, but performance are strongly impacted. As i worried about, the problem i m figuring now is that html package does not expose enough of its implementation. for example most escape functions are private, https://golang.org/src/html/template/escape.go#L48 But from

Re: [go-nuts] Packaging Test Utilities in a Project

2016-12-18 Thread Henry
Where do you put this internal package in relation to the rest of the packages? Is it something like this: project/ package1/ package2/ package3/package4/ internal/testhelpers/ I thought internal package would only be visible to its immediate parent? I want it to be usable across

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

2016-12-18 Thread Egon
On Sunday, 18 December 2016 11:16:23 UTC+2, mhh...@gmail.com wrote: > > Thanks a lot! I ve been playing a bit with it, for some simple cases it > worked great. > > Though, i looked into the html/template, am i correct to understand that > the html security layer consist of adding new cmds (of

[go-nuts] x/crypto/ssh server question

2016-12-18 Thread andrewchamberss
I am trying to get access to get public key that was used to authenticate an ssh connection (https://godoc.org/golang.org/x/crypto/ssh#ConnMetadata) inside the PublicKeyCallback while handling a channel request. I want to be able to accept the connection with any public key, but then control

Re: [go-nuts] Packaging Test Utilities in a Project

2016-12-18 Thread Dave Cheney
Like Nigel suggested project/ internal/ testhelper On Sunday, 18 December 2016 21:45:25 UTC+11, Henry wrote: > > No. I meant something like this: > > project/ > -- package1 > -- package2 > -- package3 > > Now there is a reusable test utility that is used by the tests in > package1,

Re: [go-nuts] Packaging Test Utilities in a Project

2016-12-18 Thread Henry
No. I meant something like this: project/ -- package1 -- package2 -- package3 Now there is a reusable test utility that is used by the tests in package1, package2, and package3. So the question is where do I put the test utility without exposing them as a part of the project's API? I don't

Re: [go-nuts] Packaging Test Utilities in a Project

2016-12-18 Thread Nigel Tao
On Sun, Dec 18, 2016 at 1:51 PM, Henry wrote: > I have reusable test utilities in a project. They are used by various > packages in the project for testing purposes, and at the same time I don't > want to expose these utilities as public APIs. Since it is impossible to