[go-nuts] minimum linux kernel version that can run latest golang

2020-07-24 Thread xie cui
what is the minimum version of linux kernel that can run golang? -- 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. To view

[go-nuts] my package not include in go modules

2020-07-24 Thread Ali Hassan
I want to import libraries in module file but modules add all other libraries except those packages which I had created, DB is one of them. How to import? Error , please help me to resolve -- You received this message because you are subscr

Re: [go-nuts] When set time.Location, will be detected Data Race

2020-07-24 Thread Mike Cohen
Thanks Robert, this is what I ended up doing. I wouldnt say it was trivial though :-) https://github.com/Velocidex/json Thanks and sorry for hijacking this thread. Maybe a suggestion - if users are not expected to change time.Local maybe it should be made private or at least wording in the module s

Re: [go-nuts] Does method with pointer receiver keeps track of the receiver instance

2020-07-24 Thread Ian Lance Taylor
On Fri, Jul 24, 2020 at 4:25 PM burak serdar wrote: > > On Fri, Jul 24, 2020 at 5:21 PM Ian Lance Taylor wrote: > > > > On Fri, Jul 24, 2020 at 4:07 PM Tony Yang wrote: > > > > > > Hi Go community, > > > > > > I am wondering if a method with the pointer receiver keeps the receiver > > > instanc

Re: [go-nuts] Does method with pointer receiver keeps track of the receiver instance

2020-07-24 Thread Tony Yang
I have tried the following example: https://play.golang.org/p/OfeWQH5S-Ju ``` func main() { nextFunc := getNextFunc() fmt.Println(nextFunc()) // prints 1 fmt.Println(nextFunc()) // prints 2 runtime.GC() fmt.Println(nextFunc()) // prints 3 fmt.Println(nextFunc()) // prints 4 } ``` It appears that

Re: [go-nuts] Does method with pointer receiver keeps track of the receiver instance

2020-07-24 Thread burak serdar
On Fri, Jul 24, 2020 at 5:21 PM Ian Lance Taylor wrote: > > On Fri, Jul 24, 2020 at 4:07 PM Tony Yang wrote: > > > > Hi Go community, > > > > I am wondering if a method with the pointer receiver keeps the receiver > > instance from garbage collected. > > > > To put the idea into a code example >

Re: [go-nuts] Does method with pointer receiver keeps track of the receiver instance

2020-07-24 Thread Ian Lance Taylor
On Fri, Jul 24, 2020 at 4:07 PM Tony Yang wrote: > > Hi Go community, > > I am wondering if a method with the pointer receiver keeps the receiver > instance from garbage collected. > > To put the idea into a code example > > ``` > type counter struct { > c int > } > > func (c *counter) next() int

[go-nuts] Does method with pointer receiver keeps track of the receiver instance

2020-07-24 Thread Tony Yang
Hi Go community, I am wondering if a method with the pointer receiver keeps the receiver instance from garbage collected. To put the idea into a code example ``` type counter struct { c int } func (c *counter) next() int { c.c = c.c + 1 return c.c } func getNextFunc() func () int { // Questio

Re: [go-nuts] Generic symbol metaproposal

2020-07-24 Thread David Riley
On Jul 24, 2020, at 5:50 PM, Ian Lance Taylor wrote: > > On Fri, Jul 24, 2020 at 2:22 PM wrote: > > > > On 7/23/20, Michael Jones wrote: > > ... > > > Another delight is the uppercase signal for external. > > > > > > Maybe the “how to signal it” aspect of type instantiation could look to > > >

Re: [go-nuts] Generic symbol metaproposal

2020-07-24 Thread fgergo
On Fri, Jul 24, 2020, 23:50 Ian Lance Taylor wrote: > On Fri, Jul 24, 2020 at 2:22 PM wrote: > > > > On 7/23/20, Michael Jones wrote: > > ... > > > Another delight is the uppercase signal for external. > > > > > > Maybe the “how to signal it” aspect of type instantiation could look to > > > the

Re: [go-nuts] Generic symbol metaproposal

2020-07-24 Thread Ian Lance Taylor
On Fri, Jul 24, 2020 at 2:22 PM wrote: > > On 7/23/20, Michael Jones wrote: > ... > > Another delight is the uppercase signal for external. > > > > Maybe the “how to signal it” aspect of type instantiation could look to > > these approaches as well—make the automatic understanding so magical that

[go-nuts] How to get the methods list for each struct in golang.org/x/tools/go/ssa?

2020-07-24 Thread Xudong SUN
Hello everyone, I am trying to use golang.org/x/tools/go/ssa to get the methods list of each struct type when doing static analysis on Kubernetes. This is the code I wrote to print out the method sets for each struct or interface type. cfg := packages.Config{Mode: packages.LoadAllSyntax} initia

Re: [go-nuts] Generic symbol metaproposal

2020-07-24 Thread fgergo
On 7/23/20, Michael Jones wrote: ... > Another delight is the uppercase signal for external. > > Maybe the “how to signal it” aspect of type instantiation could look to > these approaches as well—make the automatic understanding so magical that > the complete specification is unnecessary in most a

[go-nuts] Send a mail with a service account using Gmail API

2020-07-24 Thread Vincent Jouglard
Hi John, Thanks for your message. The main difference with my implementation is that I use a service account which is authorized to send messages on my behalf...and I think that this is where lies the problem. As i understand OAuth and the implementation from your exemple, a token is generated

[go-nuts] Go 1.15 Release Candidate 1 is released

2020-07-24 Thread Alexander Rakoczy
Hello gophers, We have just released go1.15rc1, a release candidate version of Go 1.15. It is cut from release-branch.go1.15 at the revision tagged go1.15rc1. Please try your production load tests and unit tests with the new version. Your help testing these pre-release versions is invaluable. Re

Re: [go-nuts] [Generics] function aliasing via variables broken for generic functions.

2020-07-24 Thread Ian Lance Taylor
On Fri, Jul 24, 2020 at 9:15 AM binary cat wrote: > > Doing `var F = Foo` (where `Foo` is a generic function) fails with an error > like this: `prog.go2:21:9: cannot use generic function Foo (value of type > func(type T1, T2)(fst T1, snd T2) Bar(T1, T2)) without instantiation in > variable decl

[go-nuts] Re: Writing bitmap data to a canvas with WebAssembly

2020-07-24 Thread Mark Farnan
Little old, but this might also help. A while back I built a helper package to deal with these issues for canvas rendering from Go. https://github.com/markfarnan/go-canvas I'm currently working on it to add WebGL support & get it working in TinyGo (some issues still). Regards Mark.

Re: [go-nuts] When set time.Location, will be detected Data Race

2020-07-24 Thread Steven Hartland
Always serialise t.UTC()? On 24/07/2020 04:26, Mike Cohen wrote: To be clear, the time.MarshalJSON() function produces valid RFC 3339 timestamps which allow arbitrary timezones. This means that local time offset is used in the string representation. Although all representations are technically

[go-nuts] go module @latest found but does not contain package

2020-07-24 Thread Tong Sun
Hi, How to get around the following, go module @latest found but does not contain package? $ cd /tmp/015-file $ GO111MODULE=on $ go mod init github.com/mkideal/cli/015-file go: creating new go.mod: module github.com/mkideal/cli/015-file $ cat go.mod module github.com/mkideal/cli/015-file g

Re: [go-nuts] When set time.Location, will be detected Data Race

2020-07-24 Thread Robert Engels
Yea, it is strange the the Json encoder api doesn’t allow the caller to provide a mashaller for any type. It would be trivial to change the code to do so. That being said I’m sure you can find custom json libs on the web that will do this. Or fork it yourself - it is not a lot of code. > On J

[go-nuts] [Generics] function aliasing via variables broken for generic functions.

2020-07-24 Thread binary cat
Doing `var F = Foo` (where `Foo` is a generic function) fails with an error like this: `prog.go2:21:9: cannot use generic function Foo (value of type func(type T1, T2)(fst T1, snd T2) Bar(T1, T2)) without instantiation in variable declaration`. Trying `var F = Foo[int,int]` fails with an error like

[go-nuts] Re: [ANN] Gio: portable immediate mode GUI programs in Go for iOS/tvOS, Android, macOS, Linux, Windows

2020-07-24 Thread ososeodijie
> > Hello, I do not want to drag us back but i really dont understand the way > to install gio everywhere i look the mwthod is not straightforward and i > dont ubderstand it can i know if there is a better way to install it > Thanks from Africa! -- You received this message because you are sub

Re: [go-nuts] When set time.Location, will be detected Data Race

2020-07-24 Thread Mike Cohen
To be clear, the time.MarshalJSON() function produces valid RFC 3339 timestamps which allow arbitrary timezones. This means that local time offset is used in the string representation. Although all representations are technically equivalent their string form is not so we need to do special parsing

[go-nuts] Send a mail with a service account using Gmail API

2020-07-24 Thread Vincent Jouglard
Hi there, I have been trying for quite some time to get over an error while trying to send an email using a service account, via the Gmail API. I get: > googleapi: Error 400: Precondition check failed., failedPrecondition Code is: package gmailApi import ( "encoding/base64" "fmt" "ne

[go-nuts] Re: golang in industrial projects

2020-07-24 Thread Erman Imer
Hello, I completed device tests, fixed bugs and updated the repository. Best regards... On Tuesday, July 7, 2020 at 8:26:42 PM UTC+3, Erman Imer wrote: > > Hello, > > I am using these libraries to communicate with Siemens S7 and Modbus Tcp > devices in industrial projects. > > https://github.co