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

2016-10-20 Thread T L
On Friday, October 21, 2016 at 1:11:32 AM UTC+8, Ian Lance Taylor wrote: > > On Thu, Oct 20, 2016 at 6:47 AM, T L > > wrote: > > > > On Thursday, October 20, 2016 at 4:46:52 PM UTC+8, Dave Cheney wrote: > >> > >> What is a pointer wrapper value? > > > > > > struct { > >p *T > > } >

[go-nuts] undefined: C in C.PCAP_NETMASK_UNKNOWN

2016-10-20 Thread Mehrdad Arshad Rad
Hi, Today I noticed the travis-ci fails once it tries to build myLG w/ latest Go version:devel +7ea5829 and shows below errors. The command "eval go get -t -v ./..." failed. github.com/google/gopacket/pcap../../google/gopacket/pcap/pcap.go:594

[go-nuts] undefined: C in C.PCAP_NETMASK_UNKNOWN

2016-10-20 Thread Mehrdad . Arshad . Rad
Hi, Today I noticed the travis-ci fails once it tries to build myLG w/ latest Go version:devel +7ea5829 and shows below errors. The command "eval go get -t -v ./..." failed. github.com/google/gopacket/pcap../../google/gopacket/pcap/pcap.go:594: undefined:

[go-nuts] Re: Like "inquirer" cli...

2016-10-20 Thread derrick . cohodas
I'm looking for the same thing! On Thursday, October 20, 2016 at 8:48:57 AM UTC-7, luism...@gmail.com wrote: > > > Hi, from Spain. > Does anyone know of a cli like inquirer for golang? > > https://github.com/sboudrias/Inquirer.js > > Thanks a lot. > -- You received this message because you are s

Re: [go-nuts] How to build my own godoc

2016-10-20 Thread Pietro Gagliardi
You can cd into ~/golang.org/x/tools/godoc and do go build to build a godoc in that directory. go install golang.org/x/tools/godoc will also use your local modification of godoc, but I don't know where it installs to anymore. > On Oct 20, 2016, at 10:08 PM, FancyGo wrote: > > Download from gi

Re: [go-nuts] How to build my own godoc

2016-10-20 Thread FancyGo
Download from github go-tool. Modified ~/gopkg/src/golang.org/x/tools/godoc/static/static.go. GOPATH is ~/gopkg 在 2016年10月21日星期五 UTC+8上午12:50:49,Pietro Gagliardi (andlabs)写道: > > Where did you download it to, what file (absolute filename) did you > modify, and what is your $GOPATH? > > On Oct 20

Re: [go-nuts] Re: Tooling experience feedback

2016-10-20 Thread roger peppe
That's a marvellous hack Aram! It would still be nicer if there was an easier way though. On 20 Oct 2016 20:09, "Aram Hăvărneanu" wrote: On Wed, Oct 19, 2016 at 7:27 PM, Nate Finch wrote: > Please give us an easy way to ensure all tests in a list of packages compile Do something like this:

Re: [go-nuts] the defer list

2016-10-20 Thread andrew . smith
Yeah, thanks for that Konstantin. I have done something fairly similar, although all my objects support a Destroyable interface with one method Destroy(). However, I think your idea to closely mimic the defer list and simply push functions is much cleaner. The basic concept seems to work quite

[go-nuts] Re: Append consecutive slices, same underlying array

2016-10-20 Thread Nick Patavalis
Opened issue here: https://github.com/golang/go/issues/17530 /npat On Thursday, October 20, 2016 at 5:22:27 PM UTC+3, T L wrote: > > yes, you are right. You can file an issue at > https://github.com/golang/go/issues > > On Thursday, October 20, 2016 at 9:11:14 PM UTC+8, Nick Patavalis wrote: >>

[go-nuts] capture template output

2016-10-20 Thread bitsofinfo . g
Within a template, how can I acheive this? {{$var := template "my-template"}} I just get "unexpected in operand" -- 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 t

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

2016-10-20 Thread Robert Griesemer
To answer the subject line question: No, short variable declarations are not technically necessary. We could have chosen not to have them. But there are good reasons for them. It was a deliberate design decision. Let me throw in a bit of historical perspective: Rob's invention of ":=" in one of h

Re: [go-nuts] Re: Tooling experience feedback

2016-10-20 Thread Aram Hăvărneanu
Yes, just tried it, it works: : emerald:aram; go test -toolexec toolexec_nolink -exec /usr/bin/true crypto... ? crypto [no test files] ok crypto/aes 0.004s ok crypto/cipher 0.012s ok crypto/des 0.012s ok crypto/dsa 0.011s ok crypto/ecdsa 0.008s ok crypto/elliptic 0.010s ok crypto/h

Re: [go-nuts] Should go vet catch people attempting to identify errors by inspecting err.Error()?

2016-10-20 Thread 'Joe Tsai' via golang-nuts
Hi Pietro, I don't think this is a vet issue since doing that pattern is not a matter of correctness, but more about style. This lint issue (https://github.com/golang/lint/issues/232) is tracking things we may want to add to golint to alert on these types of abuse. JT On Thu, Oct 20, 2016 at 11

Re: [go-nuts] Should go vet catch people attempting to identify errors by inspecting err.Error()?

2016-10-20 Thread 'Chris Manghane' via golang-nuts
+joetsai, who has been thinking about this a lot recently On Thu, Oct 20, 2016 at 11:10 AM, Pietro Gagliardi wrote: > It seems that something about the way the error interface is designed is > not intuitive enough for some, because a number of people on the IRC > channel keep coming up asking wh

[go-nuts] Should go vet catch people attempting to identify errors by inspecting err.Error()?

2016-10-20 Thread Pietro Gagliardi
It seems that something about the way the error interface is designed is not intuitive enough for some, because a number of people on the IRC channel keep coming up asking what the best way to check for a specific error is — and their first instinct is to scan the contents of the string returned

Re: [go-nuts] Re: Tooling experience feedback

2016-10-20 Thread Aram Hăvărneanu
On Wed, Oct 19, 2016 at 7:27 PM, Nate Finch wrote: > Please give us an easy way to ensure all tests in a list of packages compile Do something like this: go test -toolexec wrapper -exec success pkgs... Where wrapper is a binary that dispatches to the compiler, but a nop when called with the

[go-nuts] Interface Pitfalls and Harnessing io.Reader

2016-10-20 Thread Joshua Rubin
I just put together some thoughts to try to help newcomers to Go start to grasp interfaces. It walks through some steps that I've seen people coming from languages like Perl go through. I'd really appreciate any any vetting, comments or critiques you could offer. https://jrub.in/golang-interfac

Re: [go-nuts] Hosting godoc internally for private git server

2016-10-20 Thread Pietro Gagliardi
You can go get golang.org/x/tools/cmd/godoc and run the godoc tool itself, which will imitate golang.org. This is different from godoc.org; that is harder to host locally. > On Oct 20, 2016, at 1:13 PM, Kareem Gan wrote: > > Hello. > > Is it possible to host godoc internally because we have o

[go-nuts] Hosting godoc internally for private git server

2016-10-20 Thread Kareem Gan
Hello. Is it possible to host godoc internally because we have our own git server and would like to host godoc internally so we can build documentation for our golang repositories. -- Best, Kareem Gan 01010011 01000101 -- You received this message because you are subscribed to the Google Group

[go-nuts] Re: How to setup go-swagger for an existing project to generate API docs

2016-10-20 Thread Nathan Kerr
I just tried this out and discovered that an operationId is required for swagger:route: // swagger:route GET /profile getProfile tags go between the path and the operationId: // swagger:route GET /profile tag1 tag2 getProfile Hope this helps. On Monday, October 17, 2016 at 7:01:52 AM UTC+2,

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

2016-10-20 Thread Ian Lance Taylor
On Thu, Oct 20, 2016 at 6:47 AM, T L wrote: > > On Thursday, October 20, 2016 at 4:46:52 PM UTC+8, Dave Cheney wrote: >> >> What is a pointer wrapper value? > > > struct { >p *T > } > >> >> >> in all seriousness, if you review the git history of the Go spec you'll >> find the word "reference"

Re: [go-nuts] How to build my own godoc

2016-10-20 Thread Pietro Gagliardi
Where did you download it to, what file (absolute filename) did you modify, and what is your $GOPATH? > On Oct 20, 2016, at 3:05 AM, FancyGo wrote: > > Hi all, I have download source code of godoc. But I have no idea how to build > it. Because I have modified the source code, so I don't want us

[go-nuts] How to build my own godoc

2016-10-20 Thread FancyGo
Hi all, I have download source code of godoc. But I have no idea how to build it. Because I have modified the source code, so I don't want use the bin godoc. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and sto

[go-nuts] Like "inquirer" cli...

2016-10-20 Thread luismanolo
Hi, from Spain. Does anyone know of a cli like inquirer for golang? https://github.com/sboudrias/Inquirer.js Thanks a lot. -- 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 a

[go-nuts] Re: Golang and WebAssembly

2016-10-20 Thread Arif Hussain
I loved the idea of Go to Js transpiler. The only problem I had with Gopherjs was that it was creating huge output files, so I don't think it will be great for production right now. On Wednesday, July 8, 2015 at 8:51:29 AM UTC+5, andrewc...@gmail.com wrote: > > Fyi, Go already works in the front

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

2016-10-20 Thread T L
On Thursday, October 20, 2016 at 10:34:41 PM UTC+8, T L wrote: > > > > On Thursday, October 20, 2016 at 9:58:46 PM UTC+8, T L wrote: >> >> >> >> On Thursday, October 20, 2016 at 7:31:25 PM UTC+8, Val wrote: >>> >>> I like Alan's "useful definition" of a semantically reference type, >>> which inv

Re: [go-nuts] The [low:high] expression for creating slices

2016-10-20 Thread Nyah Check
Thanks! On Thu, Oct 20, 2016 at 3:25 PM, Konstantin Khomoutov < flatw...@users.sourceforge.net> wrote: > On Thu, 20 Oct 2016 09:45:07 +0100 > Nyah Check wrote: > > > My understanding of the [low:high] expression is Go is creating > > slices when you're copying data from an already existing slice

Re: [go-nuts] the defer list

2016-10-20 Thread Konstantin Khomoutov
On Wed, 19 Oct 2016 15:35:40 -0700 (PDT) andrew.sm...@miracl.com wrote: [...] > Im considering a scheme where I push every CString onto an > implementation of a stack, and then call defer once. Im sure some > people might think it overkill... Kinda like this : > > func Outer(arg1 string, arg2 str

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

2016-10-20 Thread T L
On Thursday, October 20, 2016 at 9:58:46 PM UTC+8, T L wrote: > > > > On Thursday, October 20, 2016 at 7:31:25 PM UTC+8, Val wrote: >> >> I like Alan's "useful definition" of a semantically reference type, which >> involves shared mutable state. >> >> About the string type, I also like the imple

Re: [go-nuts] The [low:high] expression for creating slices

2016-10-20 Thread Konstantin Khomoutov
On Thu, 20 Oct 2016 09:45:07 +0100 Nyah Check wrote: > My understanding of the [low:high] expression is Go is creating > slices when you're copying data from an already existing slice. Is it > possible to use the expression when you're creating a slice without > copying data from another slice? I

[go-nuts] Re: Append consecutive slices, same underlying array

2016-10-20 Thread T L
yes, you are right. You can file an issue at https://github.com/golang/go/issues On Thursday, October 20, 2016 at 9:11:14 PM UTC+8, Nick Patavalis wrote: > > Hi, > > It seems that the built-in append does not check for a situation like > the following, and needlessly copies data, when it could av

Re: [go-nuts] Reusable regex in Golang for rule system.

2016-10-20 Thread 'Paul Borman' via golang-nuts
Check out time.Parse : t := time.Parse("2006-01-02", inputString) year := t.Year() month := t.Month() day := t.Day() On Thu, Oct 20, 2016 at 5:06 AM, David Sofo wrote: > > Hi, > I ma new to Go Regex. > > I want to have a set of reusable rules of regex in gola

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

2016-10-20 Thread T L
On Thursday, October 20, 2016 at 7:31:25 PM UTC+8, Val wrote: > > I like Alan's "useful definition" of a semantically reference type, which > involves shared mutable state. > > About the string type, I also like the implementation detail that > > var string t = s > > is O(1) in memory and run

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

2016-10-20 Thread T L
On Thursday, October 20, 2016 at 4:46:52 PM UTC+8, Dave Cheney wrote: > > What is a pointer wrapper value? > struct { p *T } > > in all seriousness, if you review the git history of the Go spec you'll > find the word "reference" was purged about two years ago, in effect, to try > to stem

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

2016-10-20 Thread T L
On Thursday, October 20, 2016 at 4:43:08 PM UTC+8, Dave Cheney wrote: > > T L, I often hear this comment when a central repo for Go is > proposed/suggested/requested. Are you able to give details of the things > you do not like about Maven/npm/rubygems central repos. The most specific > the be

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

2016-10-20 Thread Will Sewell
Interesting, that does sound like it could be the cause. I just tried running the same benchmark on master (692df217ca21b6df8e4dc65538fcc90733e8900e), and I get the following results: gc 1 @0.004s 3%: 0.009+0.41+0.049 ms clock, 0.036+0.11/0.36/0.12+0.19 ms cpu, 4->4->3 MB, 5 MB goal, 4 P gc 2 @

[go-nuts] Append consecutive slices, same underlying array

2016-10-20 Thread Nick Patavalis
Hi, It seems that the built-in append does not check for a situation like the following, and needlessly copies data, when it could avoid it. func appendBytes(a, b []byte) []byte { if len(b) == 0 { return a } // Shouldn't append() check for somethi

[go-nuts] Reusable regex in Golang for rule system.

2016-10-20 Thread David Sofo
Hi, I ma new to Go Regex. I want to have a set of reusable rules of regex in golang easy to edit or update. For example a regex for date can be splitted in day, month and year : year=d{4} month=d{2} day=d{2} and for date we can have as following: date=year-month-day Is it possible in golang

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

2016-10-20 Thread Val
I like Alan's "useful definition" of a semantically reference type, which involves shared mutable state. About the string type, I also like the implementation detail that var string t = s is O(1) in memory and running time, i.e. it happens internally to "copy the reference, not the bytes" :

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

2016-10-20 Thread Jesper Louis Andersen
On Mon, Oct 17, 2016 at 5:08 PM adonovan via golang-nuts < golang-nuts@googlegroups.com> wrote: > > Go does not take a strong Erlang-like stance against concurrency with > shared variables, so mutexes really are critical to Go's concurrency. > > > Even Erlang took a more loose stance towards concu

Re: [go-nuts] The [low:high] expression for creating slices

2016-10-20 Thread Nyah Check
> > ng to that region in memory at run time? Or does it just reference only > that part of the existing slice. Like it's done with pointers? > > "If the sliced operand of a valid slice expression is a nil slice, the > result is a nil slice. Otherwise, the result shares its underlying array > with t

Re: [go-nuts] The [low:high] expression for creating slices

2016-10-20 Thread Jan Mercl
On Thu, Oct 20, 2016 at 11:33 AM Nyah Check wrote: > I thought that expression allocates memory corresponding to that region in memory at run time? Or does it just reference only that part of the existing slice. Like it's done with pointers? "If the sliced operand of a valid slice expression is

Re: [go-nuts] The [low:high] expression for creating slices

2016-10-20 Thread Nyah Check
Hi Jan, > > Slicing does not copy any of the backing array items. > > > I thought that expression allocates memory corresponding to that region in memory at run time? Or does it just reference only that part of the existing slice. Like it's done with pointers? Cheers! -- You received this mess

Re: [go-nuts] The [low:high] expression for creating slices

2016-10-20 Thread Jan Mercl
On Thu, Oct 20, 2016 at 10:45 AM Nyah Check wrote: > My understanding of the [low:high] expression is Go is creating slices when you're copying data from an already existing slice. Is it possible to use the expression when you're creating a slice without copying data from another slice? If yes, I

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

2016-10-20 Thread Dave Cheney
What is a pointer wrapper value? in all seriousness, if you review the git history of the Go spec you'll find the word "reference" was purged about two years ago, in effect, to try to stem these discussions. On Thursday, 20 October 2016 16:07:07 UTC+9, T L wrote: > > > > On Thursday, October 20

[go-nuts] The [low:high] expression for creating slices

2016-10-20 Thread Nyah Check
Hi Devs, My understanding of the [low:high] expression is Go is creating slices when you're copying data from an already existing slice. Is it possible to use the expression when you're creating a slice without copying data from another slice? If yes, I'll appreciate some use cases. Thanks, Nyah

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

2016-10-20 Thread Dave Cheney
For some background, I'm trying to flesh out the concerns of the various personas who would interact with a central repository. https://docs.google.com/document/d/10jbJLkmQgpi1CxHKuO75Av1tKYgtOBSjzX5Z9hnG0vI/edit?usp=sharing On Thursday, 20 October 2016 17:43:08 UTC+9, Dave Cheney wrote: > > T L

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

2016-10-20 Thread Dave Cheney
T L, I often hear this comment when a central repo for Go is proposed/suggested/requested. Are you able to give details of the things you do not like about Maven/npm/rubygems central repos. The most specific the better please. On Thursday, 20 October 2016 16:23:09 UTC+9, T L wrote: > > > > On T

[go-nuts] gocql db creation at Application

2016-10-20 Thread laxman . vallandas
Hi All, Triggering creation/alteration of db schema from two applications at same point of time is causing below error: java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.apache.cassandra.exceptions.ConfigurationException: Column family ID mismatch (found cba88010-9695-11e

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

2016-10-20 Thread T L
On Thursday, October 20, 2016 at 12:05:03 PM UTC+8, zixu mo wrote: > > 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.o

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

2016-10-20 Thread T L
On Thursday, October 20, 2016 at 3:25:18 AM UTC+8, Ian Lance Taylor wrote: > > 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

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

2016-10-20 Thread T L
On Thursday, October 20, 2016 at 12:44:26 AM UTC+8, adon...@google.com wrote: > > 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 d

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

2016-10-20 Thread T L
On Thursday, October 20, 2016 at 12:44:26 AM UTC+8, adon...@google.com wrote: > > 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 d