Re: [go-nuts] Parsing go.mod

2019-09-03 Thread James Pettyjohn
Thanks. I saw the same being done by vgo - might be viable. On Monday, September 2, 2019 at 10:52:45 PM UTC-7, kortschak wrote: > > Not really exposed, but there is code you could copy. > > https://golang.org/pkg/cmd/go/internal/modfile/#Parse > > On Mon, 2019-09-02 at 22:44 -0700, James Pettyjo

Re: [go-nuts] Parsing go.mod

2019-09-03 Thread James Pettyjohn
Sorry I left out the details. So far it's two specific properties I need for instructions in my build process: 1) The full name of the package 2) The version of the protobuf dependency for locking the right version protoc-gen-go before running protoc (that has been asked quite a few times, tota

Re: [go-nuts] Parsing go.mod

2019-09-03 Thread Paul Jolly
Also note that you can run: go mod edit -json and get JSON output. go help mod edit will given you the types you can then use to unmarshal the JSON. Failing that, the code that Dan referenced has been factored out into: https://godoc.org/github.com/rogpeppe/go-internal/modfile On

Re: [go-nuts] Parsing go.mod

2019-09-03 Thread Paul Jolly
> Sorry I left out the details. So far it's two specific properties I need for > instructions in my build process: > > 1) The full name of the package go list -f {{.Name}} example.com/blah > 2) The version of the protobuf dependency for locking the right version > protoc-gen-go before runni

[go-nuts] Re: Closed channel vs nil channel when writing

2019-09-03 Thread clement auger
The compiler will produce the same result using an uninitialized channel variable (ie nil chan); btw, the spec admits that a "nil channel" is a valid concept, several references can be found within it. You might as well quote the specification rather than rephrasing, it is way shorter and effic

[go-nuts] Re: Closed channel vs nil channel when writing

2019-09-03 Thread clement auger
sorry i can t find the added value i m looking for within those two publications. thanks for trying to help, it will be good pointers for future readers starting to learn go and reading those words. Le lundi 2 septembre 2019 19:12:03 UTC+2, Jake Montgomery a écrit : > > > On Monday, September

[go-nuts] Re: What did you see at GopherCon 2019 (San Diego)?

2019-09-03 Thread Akram Ahmad
To everyone who has (patiently) been biding time, your wait is finally over—The video recordings of the talks at GopherCon 2019 are now available at the following coordinates: GopherCon 2019 Talks . On Friday, August 9, 2019 at 8:

[go-nuts] Go compiler - syntax tree vs AST?

2019-09-03 Thread Vincent Blanchon
Hi all, The compiler documentation mentions a syntax tree in the parsing phase when the AST transformation phase mentions a conversion from the syntax tree to the compiler's AST representation. If I do not misunderstand, the command "*go tool compile -W" *will display the AST. I was wondering

Re: [go-nuts] memstats.HeapInUse is different from total in pprof

2019-09-03 Thread Ian Lance Taylor
On Mon, Sep 2, 2019 at 11:01 PM Chao Yuepan wrote: > > I have run a programas redis proxy which parses redis commands and redirects > to redis servers. > > I noticed it looks has memory leak issue. > > I use pprof to check the memory usage. It sows the total memory usage is > 856.02MB. I underst

Re: [go-nuts] Go compiler - syntax tree vs AST?

2019-09-03 Thread Ian Lance Taylor
On Tue, Sep 3, 2019 at 6:23 AM Vincent Blanchon wrote: > > The compiler documentation mentions a syntax tree in the parsing phase when > the AST transformation phase mentions a conversion from the syntax tree to > the compiler's AST representation. > If I do not misunderstand, the command "go to

[go-nuts] Re: Patch RFA: [C family frontend]: avoid weird constant values in libgo/sysinfo.go

2019-09-03 Thread Ian Lance Taylor
On Tue, Aug 20, 2019 at 4:36 PM Ian Lance Taylor wrote: > > On Mon, Aug 12, 2019 at 8:21 PM Xiangdong JI wrote: > > > > The .go files generated during building gccgo seem to have a few constants > > with weird values, for example: > > > > // sysinfo.go (on x86-64, latest gcc-9 trunk) > > > > con

[go-nuts] [ANN] sqlc: Generate type-safe Go from SQL

2019-09-03 Thread kyle
Hey folks, I'd like to introduce sqlc[0], a tool that compiles SQL queries into type-safe, idiomatic Go. It also catches common errors in SQL such as mistyped column names and incorrect parameter numbering. If this sounds like something that would be useful to you, take a read through the Get

Re: [go-nuts] Go compiler - syntax tree vs AST?

2019-09-03 Thread Vincent Blanchon
Hello Ian, Thank you for your answer. Why do you ask? Just out of curiosity, I was working with the SSA package for a tool, and since the compiler uses this package as well I wanted to go a bit deeper on that and write a small article on it. That's quite an interesting part but the usage o

[go-nuts] Re: What did you see at GopherCon 2019 (San Diego)?

2019-09-03 Thread Jake Montgomery
Yay! Thanks for the heads up. On Tuesday, September 3, 2019 at 8:09:45 AM UTC-4, Akram Ahmad wrote: > > To everyone who has (patiently) been biding time, your wait is finally > over—The video recordings of the talks at GopherCon 2019 are now available > at the following coordinates: GopherCon 20

[go-nuts] Re: What did you see at GopherCon 2019 (San Diego)?

2019-09-03 Thread Akram Ahmad
Yep, enjoy :) A ton of great talks in there. And if you haven't yet checked out the lavishly-illustrated writeup (on GopherCon 2019), head over to: *What I Saw at GopherCon 2019 * ! On Tuesday, September 3, 2019 at 1

[go-nuts] Code has OOP smells but I can't think of a better refactor

2019-09-03 Thread randomshinichi4869
First - I have a Node struct, which represents a network connection to a node. type Node struct { *apiclient.Node } func (c *Node) GetStatus() (status *models.Status, err error) func (c *Node) PostTransaction(signedEncodedTx, signedEncodedTxHash string) (err error) func (c *Node) GetTopBloc

Re: [go-nuts] [ANN] sqlc: Generate type-safe Go from SQL

2019-09-03 Thread Tyler Compton
This is very cool! It's an interesting compromise between using a fully featured ORM and interacting with SQL queries directly, and may be a good sweet spot. Have you considered supporting documentation in generated code? Maybe by allowing for syntax like this for queries: -- name: ListAuthors :m

Re: [go-nuts] Code has OOP smells but I can't think of a better refactor

2019-09-03 Thread burak serdar
On Tue, Sep 3, 2019 at 10:49 AM wrote: > > First - I have a Node struct, which represents a network connection to a node. > > > type Node struct { > *apiclient.Node > } > func (c *Node) GetStatus() (status *models.Status, err error) > func (c *Node) PostTransaction(signedEncodedTx, signedEncod

[go-nuts] Go 1.13 is released

2019-09-03 Thread Dmitri Shuralyov
Hello gophers, We just released Go 1.13. You can read the announcement blog post here: https://blog.golang.org/go1.13 You can download binary and source distributions from our download page: https://golang.org/dl/ To compile from source using a Git clone, update to the release with "git

[go-nuts] Re: Patch RFA: [C family frontend]: avoid weird constant values in libgo/sysinfo.go

2019-09-03 Thread Joseph Myers
On Tue, 3 Sep 2019, Ian Lance Taylor wrote: > > * c-cppbuiltin.c (builtin_define_with_hex_fp_value): Always expand > > when using -fgo-dump-spec. > > Ping Joseph Myers as C frontend maintainer. This patch is OK. -- Joseph S. Myers jos...@codesourcery.com -- You received this message because

[go-nuts] Re: Go Module Mirror and Checksum Database officially launched!

2019-09-03 Thread Katie Hockman
I'm also excited to share that sum.golang.google.cn is now available to Chinese users as a mirror of sum.golang.org. You can use this service by setting GOSUMDB=sum.golang.google.cn in your local environment. On Thu, Aug 29, 2019 at 2:53 PM Katie Hockman wrote: > Hey Gophers! > > We have excitin

Re: [go-nuts] memstats.HeapInUse is different from total in pprof

2019-09-03 Thread smallnest
Got it,thanks 发自我的小米手机在 Ian Lance Taylor ,2019年9月3日 21:28写道:On Mon, Sep 2, 2019 at 11:01 PM Chao Yuepan wrote: > > I have run a programas redis proxy which parses redis commands and redirects to redis servers. > > I noticed it looks has memory leak issue. > > I use pp

[go-nuts] Option to disable version validation in 1.13?

2019-09-03 Thread Steven Hartland
Trying to update to 1.13 but the new version validation breaks golangci-lint installs with: invalid pseudo-version: does not match version-control timestamp https://golang.org/doc/go1.13#version-validation lists a number of options if you're maintaining a module but nothing seems relevant for

Re: [go-nuts] Parsing go.mod

2019-09-03 Thread 'Ian Cottrell' via golang-nuts
The parsing code will eventually be public, see https://github.com/golang/go/issues/31761 When it is done, you would want golang.org/x/mod/modfile, which will be a (possibly modified) copy of the compiler internal package of the same name. On Tue, Sep 3, 2019 at 3:29 AM Paul Jolly wrote: > > So

Re: [go-nuts] Parsing go.mod

2019-09-03 Thread James Pettyjohn
That's good news, gives me some confidence that the tooling will keep working after 1.14. On Tuesday, September 3, 2019 at 6:43:15 PM UTC-7, Ian Cottrell wrote: > > The parsing code will eventually be public, see > https://github.com/golang/go/issues/31761 > When it is done, you would want golan

Re: [go-nuts] Parsing go.mod

2019-09-03 Thread James Pettyjohn
Thanks a lot for the tips. This repo is working out and should hold me over, as Ian mentioned, until golang.org/x/mod/modfile is out. On Tuesday, September 3, 2019 at 12:26:28 AM UTC-7, Paul Jolly wrote: > > Also note that you can run: > > go mod edit -json > > and get JSON output. > >

[go-nuts] Expectations for errors.Is/As with error trees

2019-09-03 Thread 'Abhinav Gupta' via golang-nuts
Hey friends, We own a library, multierr that supports writing combining zero or more errors into a single error. It supports an API like, err := multierr.Combine(err1, err2, ...) With the release of Go 1.13, we’re trying to evaluate what the expected beha

[go-nuts] Re: Option to disable version validation in 1.13?

2019-09-03 Thread t hepudds
Hello Steve, > https://golang.org/doc/go1.13#version-validation lists a number of > options if you're maintaining a module but nothing seems relevant for > CI/CD pipelines which are just trying to use tools for which they aren't > the maintainer. Regarding how to fix "invalid pseudo-version"