[go-nuts] Re: print pointer value to json...

2016-10-19 Thread abistey
Exported fields must use uppercase of capital letter. type KV struct { K string V string } On Thursday, October 20, 2016 at 9:31:32 AM UTC+8, eric wrote: > > hi, i am newer in golang. > > i want to marshal pointer value to json. > > but, i can't. how can i do that ? > > thanks, > > > package

Re: [go-nuts] Golang should have a center packages index hosting like npm, rust crates

2016-10-19 Thread Ian Lance Taylor
On Wed, Oct 19, 2016 at 9:05 PM, zixu mo wrote: > Golang should have a center packages index hosting like npm, rust crates. Go has https://godoc.org/ . Ian -- 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: Help with Go validation with SMS OTP

2016-10-19 Thread Swaroop Jayanthi
Hi All, Need a help on the OTP generation and validation on GO how to achieve this and any example or lead will be helpful, please let us know. Also please which is the best SMS gateway to use with OTP for generating OTP Thanks and Regards, --Swaroop -- You received this message because

Re: [go-nuts] Re: Proposal: add "future" internal type (similar to channel)

2016-10-19 Thread gopher
I was kind of just challenging the rhetorical question asked by stating the obvious as a question itself. On Tuesday, October 18, 2016 at 3:54:01 PM UTC-4, Rob 'Commander' Pike wrote: > > What Ian said, plus select is awkward to implement as a library, but works > quite well when its syntax is

Re: [go-nuts] time.Parse : hour out of range

2016-10-19 Thread Diego Medina
Thanks for the answers, looks like I'll keep using my work around for the time being. Diego On Wednesday, October 19, 2016 at 1:19:08 PM UTC-4, Kyle Shannon wrote: > > Related to: > > https://github.com/golang/go/issues/12919 > > On Tue, Oct 18, 2016 at 9:49 PM, Diego Medina > wrote: > > H

[go-nuts] Re: Golang should have a center packages index hosting like npm, rust crates

2016-10-19 Thread zixu mo
Even Swift https://swiftmodules.com/ -- 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://gr

[go-nuts] Golang should have a center packages index hosting like npm, rust crates

2016-10-19 Thread zixu mo
Golang should have a center packages index hosting like npm, rust crates. For Rust : https://crates.io/ For JS: https://www.npmjs.com/ For PHP https://packagist.org/ For Ruby https://rubygems.org/ -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] print pointer value to json...

2016-10-19 Thread Pietro Gagliardi
You must export the struct fields in order for package json to see them. > On Oct 19, 2016, at 8:43 PM, eric wrote: > > hi, i am newer in golang. > > i want to marshal pointer value to json. > > but, i can't. how can i do that ? > > thanks, > > > package main > > import ( > "encoding/

[go-nuts] print pointer value to json...

2016-10-19 Thread eric
hi, i am newer in golang. i want to marshal pointer value to json. but, i can't. how can i do that ? thanks, package main import ( "encoding/json" "fmt" ) type KV struct { k string v string } func main() { kv := []*KV{} obj := new(KV) obj.k = "eric" obj.v = "23" kv = append(kv, obj) obj =

Re: [go-nuts] fmt.Fscan without delimeter

2016-10-19 Thread Brian Picciano
I'd expected I'd have to do something along those lines, wanted to double check first to make sure I wasn't missing something. Thanks! On Wed, Oct 19, 2016 at 9:36 AM Jakob Borg wrote: > You could, perhaps, use ioutil.ReadAll and then typeswitch for the common > types (strings, []byte, the numer

[go-nuts] Re: Tooling experience feedback

2016-10-19 Thread Nathan Youngman
Even if there wasn't a -novendor flag, it would be nice if there was a consistent way to ignore the /vendor/ directory. This approach was provided by Andrew Gerrand's talk "Stupid Gopher Talks": go test $(go list ./... | grep -v vendor) However, the same doesn't work for all tools. The gofmt

Re: [go-nuts] the defer list

2016-10-19 Thread andrew . smith
Thanks for the advice. Im fairly new to golang, but Im used to the guarantees of C++ destructors. I think defer is a great thing and similar to the scope guard idiom. I dont think Im trying to fight the language, just trying to see if there is a way to protect myself from stupid mistakes that a

Re: [go-nuts] Are short variable declarations necessary?

2016-10-19 Thread Michael Jones
Interesting. I have never used var this way. I am the student here. (as in everything else!) From: Axel Wagner Date: Wednesday, October 19, 2016 at 2:39 PM To: Michael Jones Cc: Ian Lance Taylor , T L , golang-nuts Subject: Re: [go-nuts] Are short variable declarations necessary? var c

[go-nuts] Re: Tooling experience feedback

2016-10-19 Thread Nathan Youngman
There is a 2013 proposal from Russ Cox that includes a -watch flag in the go tool. https://docs.google.com/document/d/1xl_aRcCbksFRmCKtoyRQG9L7j6DIdMZtrkFAoi5EXaA/edit "a possible extension would be to add -watch flag to “go test,” “go > install,” and “go run,” which would repeat the command e

Re: [go-nuts] Are short variable declarations necessary?

2016-10-19 Thread 'Axel Wagner' via golang-nuts
var could do that too: https://play.golang.org/p/v9pQSZPTh_ (not that I'm advocating in favor of var in more places) On Wed, Oct 19, 2016 at 11:17 PM, Michael Jones wrote: > In fact, this example hints at something important. You could do as you > say and create variables of *different* types wh

Re: [go-nuts] the defer list

2016-10-19 Thread 'Thomas Bushnell, BSG' via golang-nuts
Ah, yes, that's true indeed. On Wed, Oct 19, 2016 at 2:33 PM adonovan via golang-nuts < golang-nuts@googlegroups.com> wrote: > On Wednesday, 19 October 2016 16:50:55 UTC-4, Thomas Bushnell, BSG wrote: > > On Wed, Oct 19, 2016 at 1:47 PM Pietro Gagliardi > wrote: > > Manual memory management is a

Re: [go-nuts] the defer list

2016-10-19 Thread adonovan via golang-nuts
On Wednesday, 19 October 2016 16:50:55 UTC-4, Thomas Bushnell, BSG wrote: > > On Wed, Oct 19, 2016 at 1:47 PM Pietro Gagliardi > wrote: > >> Manual memory management is a part of life in the C world. defer is the >> solution that Go comes up with to situations where explicit cleanup is >> necess

Re: [go-nuts] interface as valid method receivers ?

2016-10-19 Thread xingtao zhao
I think the original proposition is not to add default implementation for the methods in an interface. The proposal was just want to add extra methods to the interface. These methods will not get into the vtable of the interface. Yes, this can be implemented by package level function, but it is

Re: [go-nuts] Go 1.7.3 is released

2016-10-19 Thread Peter Kleiweg
Same problem here. Also, after the last package test cmd/vet/internal/cfg, all further tests are skipped. GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/net/aps/64/opt/gosite" GORACE="" GOROOT="/net/aps/64/opt/go" GOTOOLDIR="/net/aps/64/opt/go/pkg/tool/

Re: [go-nuts] Are short variable declarations necessary?

2016-10-19 Thread Michael Jones
In fact, this example hints at something important. You could do as you say and create variables of *different* types which I find very general compared to the suggested var feature: for a, b, c := 0, 0.5, big.NewFloat(0.5).SetPrec(200); a < 15; a++ { (https://play.golang.org/p/OM7OC3R949) ---

Re: [go-nuts] the defer list

2016-10-19 Thread 'Thomas Bushnell, BSG' via golang-nuts
On Wed, Oct 19, 2016 at 1:47 PM Pietro Gagliardi wrote: > Manual memory management is a part of life in the C world. defer is the > solution that Go comes up with to situations where explicit cleanup is > necessary, and it's a powerful tool that I'm pretty sure *is* an innovation > Go did first.

Re: [go-nuts] Go 1.7.3 is released

2016-10-19 Thread Edward Muller
See: https://github.com/golang/go/issues/17519 & https://github.com/golang/go/issues/17276 On Wed, Oct 19, 2016 at 1:48 PM Tim Henderson wrote: > I can reproduce that error. Here is my `go env` output the test output is > identical. > > $ go env > GOARCH="amd64" > GOBIN="" > GOEXE="" > GOHOSTARC

Re: [go-nuts] the defer list

2016-10-19 Thread Pietro Gagliardi
All right then. Good to know, thanks. > On Oct 19, 2016, at 4:50 PM, Thomas Bushnell, BSG > wrote: > > On Wed, Oct 19, 2016 at 1:47 PM Pietro Gagliardi > wrote: > Manual memory management is a part of life in the C world. defer is the > solution that Go comes up wit

Re: [go-nuts] Issue report of golang wiki.

2016-10-19 Thread Andrew Gerrand
The wiki code is correct. r.URL.Path should begin with a slash, always. I'm not sure what you're doing that is different. That wiki code is tested, though. On 19 October 2016 at 21:15, KIDJourney wrote: > Hi every one . > I am new guy to golang. > When I am reading golang wiki about web

Re: [go-nuts] Go 1.7.3 is released

2016-10-19 Thread Tim Henderson
I can reproduce that error. Here is my `go env` output the test output is identical. $ go env GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/hendersont/stuff/code/godev" GORACE="" GOROOT="/home/hendersont/srcs/go" GOTOOLDIR="/home/hendersont/srcs/

Re: [go-nuts] the defer list

2016-10-19 Thread Pietro Gagliardi
Manual memory management is a part of life in the C world. defer is the solution that Go comes up with to situations where explicit cleanup is necessary, and it's a powerful tool that I'm pretty sure *is* an innovation Go did first. If you just follow the idiom cstr := C.CString(str)

Re: [go-nuts] the defer list

2016-10-19 Thread andrew . smith
I thought someone might ask! Im writing many wrapper functions to C functions that take multiple C.char* arguments. All of these require a call to C.free() before the wrapper function terminates. I can do this with defer but Im absolutely sure Im going to miss one or more of these out. So I was

Re: [go-nuts] the defer list

2016-10-19 Thread andrew . smith
I thought you might Im writing many wrapper functions to C functions that take multiple C.char*. All of these require a defer statement to free the C string when the wrapper function terminates. Im absolutely sure Im going to miss one or more of these out, so I was wondering if I could get hold

Re: [go-nuts] Go 1.7.3 is released

2016-10-19 Thread alb . donizetti
It *wasn't* backported. Il giorno mercoledì 19 ottobre 2016 22:17:51 UTC+2, alb.do...@gmail.com ha scritto: > > The time failure is Issue 17276. I patched it on tip > but it was backported in 1.7 > > Il giorno mercoledì 19 ottobre 2016 22:10:42 UTC+2, Jan Mercl ha scritto: >> >> On Wed, Oct 19, 2

Re: [go-nuts] Go 1.7.3 is released

2016-10-19 Thread alb . donizetti
The time failure is Issue 17276. I patched it on tip but it was backported in 1.7 Il giorno mercoledì 19 ottobre 2016 22:10:42 UTC+2, Jan Mercl ha scritto: > > On Wed, Oct 19, 2016 at 9:45 PM Chris Broadfoot > wrote: > > > We have just released Go version 1.7.3, a minor point release. > > Package

Re: [go-nuts] the defer list

2016-10-19 Thread andrew . smith
I thought you might Im writing many wrapper functions to C functions that take multiple C.char*. All of these require a defer statement to free the C string when the wrapper function terminates. Im absolutely sure Im going to miss one or more of these out, so I was wondering if I could get hold

Re: [go-nuts] Go 1.7.3 is released

2016-10-19 Thread Michael Hudson-Doyle
That's https://github.com/golang/go/issues/17276, which if I'd been paying a bit more attention I'd have suggested go into 1.7.3 :( It's not an indicator of a real problem fortunately. Cheers, mwh On 20 October 2016 at 09:10, Jan Mercl <0xj...@gmail.com> wrote: > On Wed, Oct 19, 2016 at 9:45 PM

Re: [go-nuts] Go 1.7.3 is released

2016-10-19 Thread Jan Mercl
On Wed, Oct 19, 2016 at 9:45 PM Chris Broadfoot wrote: > We have just released Go version 1.7.3, a minor point release. Package time fails test. jnml@4670:~$ cd ~/go/src/ jnml@4670:~/go/src$ go env GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/j

Re: [go-nuts] the defer list

2016-10-19 Thread Ian Lance Taylor
On Wed, Oct 19, 2016 at 12:31 PM, wrote: > > This is probably a long shot, but is it possible to get a reference to the > list of functions that the 'defer' statement populates? Is it exposed and/or > is it specific? The list is not available. Ian -- You received this message because you are

[go-nuts] Go 1.7.3 is released

2016-10-19 Thread Chris Broadfoot
Hi gophers, We have just released Go version 1.7.3, a minor point release. This release includes fixes to the compiler, runtime, and the the crypto/cipher, crypto/tls, net/http, and strings packages. https://golang.org/doc/devel/release.html#go1.7.minor You can download binary and source dis

Re: [go-nuts] the defer list

2016-10-19 Thread Pietro Gagliardi
What do you want to do with it? > On Oct 19, 2016, at 3:31 PM, andrew.sm...@miracl.com wrote: > > Hi, > > This is probably a long shot, but is it possible to get a reference to the > list of functions that the 'defer' statement populates? Is it exposed and/or > is it specific? > > Andy > > -

Re: [go-nuts] switch fallthrough

2016-10-19 Thread Pietro Gagliardi
In addition, it just so happens that the break at the end situation is the most common situation for a switch statement. So all Go did was flip the requirements: instead of needing an explicit break to not fall through, have an explicit fallthrough to not break. The Go model of break by default

Re: [go-nuts] interface as valid method receivers ?

2016-10-19 Thread Viktor Kojouharov
On Wednesday, October 19, 2016 at 10:16:50 PM UTC+3, Jan Mercl wrote: > > On Wed, Oct 19, 2016 at 8:58 PM Viktor Kojouharov > wrote: > > > Not really, as this is all hypothetical, it might be implemented in a > way so that any type that wants to satisfy an interface with default > methods has

[go-nuts] the defer list

2016-10-19 Thread andrew . smith
Hi, This is probably a long shot, but is it possible to get a reference to the list of functions that the 'defer' statement populates? Is it exposed and/or is it specific? Andy -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe fr

Re: [go-nuts] Are short variable declarations necessary?

2016-10-19 Thread Ian Lance Taylor
On Wed, Oct 19, 2016 at 11:38 AM, Michael Jones wrote: > As in a number of previous questions, this one was asked poorly and the > answers dance all around the intention. I had decided never to enter the fray > of these oddly-put assertion/half questions, but since this is lingering, may > I su

Re: [go-nuts] interface as valid method receivers ?

2016-10-19 Thread Jan Mercl
On Wed, Oct 19, 2016 at 8:58 PM Viktor Kojouharov wrote: > Not really, as this is all hypothetical, it might be implemented in a way so that any type that wants to satisfy an interface with default methods has to at least implement all non-default ones. That is to say, with the above example inte

Re: [go-nuts] Re: simplifying freeing CString

2016-10-19 Thread andrew . smith
Thanks, I actually did a test for this by calling runtime.GC() within the function and it is indeed collected. On Wednesday, October 19, 2016 at 5:43:47 PM UTC+1, Ian Lance Taylor wrote: > > On Wed, Oct 19, 2016 at 9:04 AM, > > wrote: > >> I have a follow up question. In the above example doe

Re: [go-nuts] interface as valid method receivers ?

2016-10-19 Thread Viktor Kojouharov
On Wednesday, October 19, 2016 at 6:52:30 PM UTC+3, Jan Mercl wrote: > > > On Wed, Oct 19, 2016 at 5:40 PM Viktor Kojouharov > wrote: > > > That's just a default method implementation. There's nothing inherently > confusing about what gets called. If a concrete implementation exists, that > ge

Re: [go-nuts] Are short variable declarations necessary?

2016-10-19 Thread Michael Jones
As in a number of previous questions, this one was asked poorly and the answers dance all around the intention. I had decided never to enter the fray of these oddly-put assertion/half questions, but since this is lingering, may I suggest that this is his real question: “can we have var-style de

Re: [go-nuts] switch fallthrough

2016-10-19 Thread Konstantin Khomoutov
On Wed, 19 Oct 2016 18:47:03 +0300 Konstantin Khomoutov wrote: [...] > > Please, can you explain the follwing output: [...] > In addition to what Ian said, the way to understand how this works, > is to compare it with how it works in C. In C, where the "classic" > switch was implemented (and the

[go-nuts] Re: Tooling experience feedback

2016-10-19 Thread Nate Finch
Please give us an easy way to ensure all tests in a list of packages compile. right now I have to go test ./... -test.run=xxx ... and that does all the linking and crap that I don't care about into N binaries, which takes forever. I just want to know if I caught all the places that need t

Re: [go-nuts] time.Parse : hour out of range

2016-10-19 Thread Kyle Shannon
Related to: https://github.com/golang/go/issues/12919 On Tue, Oct 18, 2016 at 9:49 PM, Diego Medina wrote: > Hi, > > From a 3rd party I get a file with time like 1503 or 900 (meaning 3:03PM or > 9:00 AM) > > so I thought I could use this format: > > https://play.golang.org/p/RKR71hTWGo > > x, e

[go-nuts] Re: Centos - golang 1.6/1.7 - dial tcp i/o timeout

2016-10-19 Thread subbagudipalli
This issue was due to golang 1.7 version and it is resolved after build the code with golang 1.7.1 version. For details: https://github.com/golang/go/issues/16865 On Sunday, October 16, 2016 at 3:54:43 PM UTC-5, subbagu...@gmail.com wrote: > > > Getting dail tcp error while calling httpClient.

Re: [go-nuts] What is called reference values in Golang?

2016-10-19 Thread adonovan via golang-nuts
On Wednesday, 19 October 2016 06:33:09 UTC-4, Jan Mercl wrote: > > On Wed, Oct 19, 2016 at 12:27 PM T L > > wrote: > > Nothing. The language specification does not mention it. > > People use that term based on definitions specified for other programming > languages, but those are not always equal

Re: [go-nuts] Re: simplifying freeing CString

2016-10-19 Thread Ian Lance Taylor
On Wed, Oct 19, 2016 at 9:04 AM, wrote: >> I have a follow up question. In the above example does golang give any >> guarantee about the earliest point at which the temporay WrappedString >> instance is collected. I mean, is it possible that the GC will collect the >> WrappedString whilst the fu

[go-nuts] Re: Why does a "concurrent" Go GC phase appear to be stop-the-world?

2016-10-19 Thread rhys . hiltner
Yes, this sounds a lot like https://golang.org/issue/16293, where goroutines that allocate memory while the garbage collector is running can end up stalled for nearly the entire GC cycle, in programs where a large amount of the memory is in a single allocation. For the program you've shared, th

[go-nuts] Re: High CPU usage for process using mdns (Flame graph attached) - time spent in runtime.goexit and runtime.mstart

2016-10-19 Thread rhys . hiltner
I'm not sure. You mention that there's only a single mDNS query per minute, so the five-second timeouts would never overlap. Looking at the profile again, a lot of the time seems to be spent on the locks involved in sleeping for some amount of time. This makes it seem like there are a lot of ac

[go-nuts] Re: simplifying freeing CString

2016-10-19 Thread andrew . smith
> > I have a follow up question. In the above example does golang give any > guarantee about the earliest point at which the temporay WrappedString > instance is collected. I mean, is it possible that the GC will collect the > WrappedString whilst the function simulatedCall is still executing

Re: [go-nuts] interface as valid method receivers ?

2016-10-19 Thread Jakob Borg
The one way this could be possibly useful, in my opinion, would be to add methods to existing interfaces (from other packages no less), a la extensions in Objective-C (and Swift). So say extending io.Reader { ReadAll() ([]byte, error) } func (r io.Reader) ReadAll() ([]byte, error) { // implem

Re: [go-nuts] interface as valid method receivers ?

2016-10-19 Thread Konstantin Khomoutov
On Wed, 19 Oct 2016 08:40:51 -0700 (PDT) Viktor Kojouharov wrote: [...] > > type Foo interface { > > func DoSomething() > > } > > > > func (f Foo) DoSomething() { > > } > > > > var f Foo > > > > f.DoSomething() > > > > How do you propose to distinguish these two DoSomethi

Re: [go-nuts] interface as valid method receivers ?

2016-10-19 Thread Jan Mercl
On Wed, Oct 19, 2016 at 5:40 PM Viktor Kojouharov wrote: > That's just a default method implementation. There's nothing inherently confusing about what gets called. If a concrete implementation exists, that gets called, otherwise the default one does. But to assign something to f (of type Foo) i

Re: [go-nuts] switch fallthrough

2016-10-19 Thread Konstantin Khomoutov
On Wed, 19 Oct 2016 06:27:47 -0700 (PDT) hannover.p...@gmail.com wrote: > Please, can you explain the follwing output: > > >4 > =5 > <4 > > --- > > // Go 1.7.1 > > package main > > import "fmt" > > func main() { >x := 5 > >switch { >case x > 4: > fmt.Pr

Re: [go-nuts] interface as valid method receivers ?

2016-10-19 Thread Viktor Kojouharov
On Tuesday, October 18, 2016 at 9:27:36 PM UTC+3, Konstantin Khomoutov wrote: > > On Tue, 18 Oct 2016 11:11:59 -0700 (PDT) > parais...@gmail.com wrote: > > > Obviously in Go this is a compile time error : > > > > type Foo interface {} > > > > > > func (f Foo) DoSomething(){} > > > I w

Re: [go-nuts] fmt.Fscan without delimeter

2016-10-19 Thread Jakob Borg
You could, perhaps, use ioutil.ReadAll and then typeswitch for the common types (strings, []byte, the numerics) that you can easily handle. If the given receiver was not of one of those types, try to cast it to an encoding.BinaryUnmarshaler and/or encoding.TextUnmarshaler since that's essentially w

Re: [go-nuts] fmt.Fscan without delimeter

2016-10-19 Thread Brian Picciano
Hi Ian! I don't think that would work, my data can be pretty much any arbitrary data, including binary data. So I would need to tell Fscan to ignore any spaces it sees in the data itself, and then somehow accept the space which I replaced from EOF. On Wed, Oct 19, 2016 at 8:38 AM Ian Davis wrote:

Re: [go-nuts] Are short variable declarations necessary?

2016-10-19 Thread Ian Lance Taylor
On Wed, Oct 19, 2016 at 3:24 AM, T L wrote: > > On Wednesday, October 19, 2016 at 5:43:48 AM UTC+8, Ian Lance Taylor wrote: >> >> On Tue, Oct 18, 2016 at 7:50 AM, T L wrote: >> > >> > On Tuesday, October 18, 2016 at 10:40:02 PM UTC+8, Ian Lance Taylor >> > wrote: >> >> >> >> On Tue, Oct 18, 2016

Re: [go-nuts] fmt.Fscan without delimeter

2016-10-19 Thread Ian Davis
On Wed, Oct 19, 2016, at 03:34 PM, Brian Picciano wrote: > Hi there! My use-case involves reading all data off of an io.Reader > and scanning it into a receiver value provided by the user of my > library. In many ways the same thing as fmt.Fscan. The difference is > that only one receiver value is

[go-nuts] fmt.Fscan without delimeter

2016-10-19 Thread Brian Picciano
Hi there! My use-case involves reading all data off of an io.Reader and scanning it into a receiver value provided by the user of my library. In many ways the same thing as fmt.Fscan. The difference is that only one receiver value is allowed, and I want to read _all_ data until io.EOF, not just

Re: [go-nuts] switch fallthrough

2016-10-19 Thread Ian Lance Taylor
On Wed, Oct 19, 2016 at 6:27 AM, wrote: > Please, can you explain the follwing output: > >>4 > =5 > <4 > > --- > > // Go 1.7.1 > > package main > > import "fmt" > > func main() { >x := 5 > >switch { >case x > 4: > fmt.Println(">4") > fallthrough

[go-nuts] switch fallthrough

2016-10-19 Thread hannover . post
Please, can you explain the follwing output: >4 =5 <4 --- // Go 1.7.1 package main import "fmt" func main() { x := 5 switch { case x > 4: fmt.Println(">4") fallthrough case x == 5: fmt.Println("=5") fallthrou

Re: [go-nuts] cgo1.7.1 arm: irregular execution time

2016-10-19 Thread Konstantin Khomoutov
On Tue, 18 Oct 2016 22:12:44 -0700 (PDT) tpoisonooo wrote: > My colleague gives me a `face_recognization.so`, > `face_recognization.so` use `libcaffe.so`. > I compiled it with cgo based on arm. [...] > 1. In his C++ demo, `Face_Feature_Extract` function always cost 0.1 > second. > > 2. In my go

[go-nuts] Re: Why does a "concurrent" Go GC phase appear to be stop-the-world?

2016-10-19 Thread rlh
This is likely 23540 . On Wednesday, October 19, 2016 at 8:32:18 AM UTC-4, Will Sewell wrote: > > Hey, I previously posted this on StackOverflow, but I was told this > mailing list would be a better forum for discussion. > > I am attempting to ben

Re: [go-nuts] Why does a "concurrent" Go GC phase appear to be stop-the-world?

2016-10-19 Thread Konstantin Khomoutov
On Wed, 19 Oct 2016 04:26:09 -0700 (PDT) Will Sewell wrote: > Hey, I previously posted this on StackOverflow, but I was told this > mailing list would be a better forum for discussion. JFTR here's the discussion on SO: [...] -- You received this me

[go-nuts] Re: time.Parse : hour out of range

2016-10-19 Thread T L
On Wednesday, October 19, 2016 at 11:49:52 AM UTC+8, Diego Medina wrote: > > Hi, > > From a 3rd party I get a file with time like 1503 or 900 (meaning 3:03PM > or 9:00 AM) > > so I thought I could use this format: > > https://play.golang.org/p/RKR71hTWGo > > x, err := time.Parse("1504", "900")

[go-nuts] Issue report of golang wiki.

2016-10-19 Thread KIDJourney
Hi every one . I am new guy to golang. When I am reading golang wiki about web development I find a small issue in the article, Here is the wiki page i read https://golang.org/doc/articles/wiki/#tmp_11 . At the section of Validation, it creates a regexp to valid and get the file name

[go-nuts] cgo1.7.1 arm: irregular execution time

2016-10-19 Thread tpoisonooo
My colleague gives me a `face_recognization.so`, `face_recognization.so` use `libcaffe.so`. I compiled it with cgo based on arm. cgo code: package algo /* #include "load_so.h" #cgo CFLAGS: -std=gnu99 #cgo LDFLAGS: -ldl #cgo LDFLAGS: -L./ -L/usr/lib -L/usr/local/lib -L/us

[go-nuts] Re: Tooling experience feedback

2016-10-19 Thread kburkeorg
One tool I add to most of my projects is a Make target that opens documentation for the current project in a web browser. I wrote a short binary to do this here: https://github.com/kevinburke/godocdoc It would also be nice to be able to jump easily from a bug number, e.g. 17391, to the relevan

[go-nuts] Why does a "concurrent" Go GC phase appear to be stop-the-world?

2016-10-19 Thread Will Sewell
Hey, I previously posted this on StackOverflow, but I was told this mailing list would be a better forum for discussion. I am attempting to benchmark the maximum STW GC pause time for different numbers of heap objects. To do this I have written a simple benchmark that pushes and pops messages f

Re: [go-nuts] Are short variable declarations necessary?

2016-10-19 Thread Jan Mercl
On Wed, Oct 19, 2016 at 12:51 PM T L wrote: > but I don't want to leak i in outer block, and adding a {} pair is overkill. That's an example answering the question in the title of this thread. -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] Are short variable declarations necessary?

2016-10-19 Thread T L
On Wednesday, October 19, 2016 at 6:28:21 PM UTC+8, Nyah Check wrote: > > This can still work > > *var int i = 0* > *for i < MAX {* > * //statements here* > * i++* > *}* > > Cheers! > but I don't want to leak i in outer block, and adding a {} pair is overkill. > > On Wed, Oct 19, 2016 at 11:

Re: [go-nuts] What is called reference values in Golang?

2016-10-19 Thread Jan Mercl
On Wed, Oct 19, 2016 at 12:27 PM T L wrote: Nothing. The language specification does not mention it. People use that term based on definitions specified for other programming languages, but those are not always equal to each other. -- -j -- You received this message because you are subscribe

Re: [go-nuts] Are short variable declarations necessary?

2016-10-19 Thread Nyah Check
> > > *var int i = 0* > var i int = 0 -- 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://gr

Re: [go-nuts] Are short variable declarations necessary?

2016-10-19 Thread Nyah Check
This can still work *var int i = 0* *for i < MAX {* * //statements here* * i++* *}* Cheers! On Wed, Oct 19, 2016 at 11:24 AM, T L wrote: > > > On Wednesday, October 19, 2016 at 5:43:48 AM UTC+8, Ian Lance Taylor wrote: > >> On Tue, Oct 18, 2016 at 7:50 AM, T L wrote: >> > >> > On Tuesday,

[go-nuts] What is called reference values in Golang?

2016-10-19 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] Are short variable declarations necessary?

2016-10-19 Thread Nyah Check
> > sorry, from my experience, short form doesn't reduces the number of lines > immensely comparing to var form. > And sometimes, more code lines are needed by using short form. > > Yeah, sometimes. But we are not forced to use it though; Anyone can use any feature as they see fit. Cheers! -- "Th

Re: [go-nuts] Are short variable declarations necessary?

2016-10-19 Thread T L
On Wednesday, October 19, 2016 at 5:43:48 AM UTC+8, Ian Lance Taylor wrote: > > On Tue, Oct 18, 2016 at 7:50 AM, T L > > wrote: > > > > On Tuesday, October 18, 2016 at 10:40:02 PM UTC+8, Ian Lance Taylor > wrote: > >> > >> On Tue, Oct 18, 2016 at 7:21 AM, T L wrote: > >> > > >> > alterna

Re: [go-nuts] Are short variable declarations necessary?

2016-10-19 Thread T L
On Wednesday, October 19, 2016 at 6:06:22 AM UTC+8, Nyah Check wrote: > > Hi TL, > > I can't talk on behalf of the creators of the language; but from my > personal experience; it makes code more succinct and easier to write; > something more or less like "doing more with less" if you know what