Re: [go-nuts] Any recommendation for structured logging library in Golang?

2020-11-17 Thread Gopal M
go.uber.org/zap On Wed, Nov 18, 2020 at 12:48 PM Mike Spreitzer wrote: > > From: ChrisLu > > To: golang-nuts > > Date: 11/17/2020 11:22 PM > > Subject: [EXTERNAL] [go-nuts] Any recommendation for structured > > logging library in Golang? > > Sent by: golang-nuts@googlegroups.com > > > > I am

Re: [go-nuts] Any recommendation for structured logging library in Golang?

2020-11-17 Thread Mike Spreitzer
> From: ChrisLu > To: golang-nuts > Date: 11/17/2020 11:22 PM > Subject: [EXTERNAL] [go-nuts] Any recommendation for structured > logging library in Golang? > Sent by: golang-nuts@googlegroups.com > > I am considering moving from glog to structured logging. I tried > logrus, go-kit, uber/zap,

[go-nuts] Any recommendation for structured logging library in Golang?

2020-11-17 Thread ChrisLu
I am considering moving from glog to structured logging. I tried logrus, go-kit, uber/zap, but could not find one good fit. In short, this is the desired format: [info][timestamp] [filename:line_number] message k1=v1 k2=v2 ... It shows the correct file name(need to pop out a few call stacks)

Re: [go-nuts] i can't use defer c.free to release the cgo.cstring memory when my func return the cstring

2020-11-17 Thread 杜仲
that's the problem, i use c just like an channel, the value final send to other language. i know i can make an call back function in c and then release that memory in c code. regrettably, this will take many time and i don;t have so much. however ,thx 在2020年11月18日星期三 UTC+8 上午10:43:20 写道: > On

Re: [go-nuts] i can't use defer c.free to release the cgo.cstring memory when my func return the cstring

2020-11-17 Thread Ian Lance Taylor
On Tue, Nov 17, 2020 at 6:38 PM 杜仲 wrote: > > my go version is 1.13. > i used cgo.cstring in my func, and the func will return cstring. > i don't know when c complete work about the cstring memory. > if i used defer c.free to release the cstring memory, the cstring val will > change and return a

[go-nuts] i can't use defer c.free to release the cgo.cstring memory when my func return the cstring

2020-11-17 Thread 杜仲
my go version is 1.13. i used cgo.cstring in my func, and the func will return cstring. i don't know when c complete work about the cstring memory. if i used defer c.free to release the cstring memory, the cstring val will change and return a unexpected value, especially at often apply memory on

Re: [go-nuts] gollvm: Issues on Alpine linux. Tentative definition has type 'struct sigstack' that is never completed, in sysinfo.c

2020-11-17 Thread Ian Lance Taylor
On Tue, Nov 17, 2020 at 6:11 AM Than McIntosh wrote: > > > /home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/gofrontend/libgo/sysinfo.c:462:1: > > error: tentative definition has type 'struct sigstack' that is never > > completed > > SREF(sigstack); > > ^ > > I don't know why sysinfo.c

Re: [go-nuts] Making syscalls in the syscall package

2020-11-17 Thread Ian Lance Taylor
On Tue, Nov 17, 2020 at 8:20 AM Aidan Hahn wrote: > > I am currently patching my local go runtime to fix a bug it has. I would like > to make the signal() syscall, or at least the sigaction() syscall from inside > the syscall package but it looks like those functions are defined as private >

Re: [go-nuts] Minisign for x/crypto

2020-11-17 Thread Ian Lance Taylor
[ + Filippo ] On Tue, Nov 17, 2020 at 12:56 PM 'Péter Szilágyi' via golang-nuts wrote: > > Hey all, > > This is just a quick question whether the Go maintainers would be > interested in a package contribution to `x/crypto` to implement minisign? > https://jedisct1.github.io/minisign/ > >

[go-nuts] Re: Not getting 1.15.5 as the latest Go version - getgo

2020-11-17 Thread Diego Medina
I entered https://github.com/golang/go/issues/42676 and I sent the related CL On Tuesday, November 17, 2020 at 2:23:45 PM UTC-5 Diego Medina wrote: > great, thanks! Then I'll see about raising an issue/PR with the project > that uses that url. > > > > On Tuesday, November 17, 2020 at 2:09:19

Re: [go-nuts] Ambiguous Method Promotion Bug?

2020-11-17 Thread 'Axel Wagner' via golang-nuts
"and so does zz.X.Fun", of course. On Tue, Nov 17, 2020 at 10:14 PM Axel Wagner wrote: > Hi, > > the relevant spec section is https://golang.org/ref/spec#Selectors > > A selector f may denote a field or method f of a type T, or it may refer >> to a field or method f of a nested embedded field

Re: [go-nuts] Ambiguous Method Promotion Bug?

2020-11-17 Thread 'Axel Wagner' via golang-nuts
Hi, the relevant spec section is https://golang.org/ref/spec#Selectors A selector f may denote a field or method f of a type T, or it may refer to > a field or method f of a nested embedded field of T. The number of embedded > fields traversed to reach f is called its depth in T. The depth of a

[go-nuts] Minisign for x/crypto

2020-11-17 Thread 'Péter Szilágyi' via golang-nuts
Hey all, This is just a quick question whether the Go maintainers would be interested in a package contribution to `x/crypto` to implement minisign? https://jedisct1.github.io/minisign/ Cheers, Peter -- You received this message because you are subscribed to the Google Groups

[go-nuts] Ambiguous Method Promotion Bug?

2020-11-17 Thread Michal Ostrowski
Here is a playground doc that demonstrates what seems to be strange behavior regarding promotion of methods. https://play.golang.org/p/R9M1lAOd9CA It seems that I can generate a struct a have an ambiguous method by adding a level of indirection in struct definitions. Or there's something in

Re: [go-nuts] How to detect HTTP client stop polling at the server side

2020-11-17 Thread Shulhan
> On 18 Nov 2020, at 01.06, Afriyie Abraham Kwabena > wrote: > > Hi, > > The UpdateData function is the HTTP handler for the route which matches the > URL and is called after the mux.Router after receiving an incoming request > matches the incoming request > against the registered

[go-nuts] Re: Not getting 1.15.5 as the latest Go version - getgo

2020-11-17 Thread Diego Medina
great, thanks! Then I'll see about raising an issue/PR with the project that uses that url. On Tuesday, November 17, 2020 at 2:09:19 PM UTC-5 seank...@gmail.com wrote: > VERSION reports the version the site is under, use > https://golang.org/dl/?mode=json instead > > On Tuesday, November 17,

[go-nuts] Re: Not getting 1.15.5 as the latest Go version - getgo

2020-11-17 Thread seank...@gmail.com
VERSION reports the version the site is under, use https://golang.org/dl/?mode=json instead On Tuesday, November 17, 2020 at 5:21:43 PM UTC+1 fmpw...@gmail.com wrote: > Hi, > > Today I tried the getgo [1] binary but instead of providing Go 1.15.5, it > installed 1.15.4. I looked around the

Re: [go-nuts] How to detect HTTP client stop polling at the server side

2020-11-17 Thread Afriyie Abraham Kwabena
Hi, The UpdateData function is the HTTP handler for the route which matches the URL and is called after the mux.Router after receiving an incoming request matches the incoming request against the registered route. BR Afriyie On Tuesday, November 17, 2020 at 7:33:50 PM UTC+2 Afriyie

Re: [go-nuts] How to detect HTTP client stop polling at the server side

2020-11-17 Thread Afriyie Abraham Kwabena
Hi, I have made changes according to the comments and also simply the main function but am not sure if the worker go routine works. This what i did: type Route struct { Namestring Method string Pattern string HandlerFunc http.HandlerFunc } var idtime =

[go-nuts] Not getting 1.15.5 as the latest Go version - getgo

2020-11-17 Thread Diego Medina
Hi, Today I tried the getgo [1] binary but instead of providing Go 1.15.5, it installed 1.15.4. I looked around the code and ended up in https://golang.org/VERSION?m=text which reports 1.15.4 as the latest. Is this the right place to report this to get it fixed? [1]

[go-nuts] Making syscalls in the syscall package

2020-11-17 Thread Aidan Hahn
Good Morning/Afternoon/Evening, I am currently patching my local go runtime to fix a bug it has. I would like to make the signal() syscall, or at least the sigaction() syscall from inside the syscall package but it looks like those functions are defined as private within the runtime package.

Re: [go-nuts] Any general VPN(pptp, l2tp, openVPN, IPSec VPN) server implementation in go?

2020-11-17 Thread Sergey Matveev
Greetings! *** Nathan [2020-11-17 02:33]: >But I did a lot of research, it seems there is no go implementation for the >general VPN. There is pure Go ESPv3/IKEv2 implementation: http://www.gostipsec.cypherpunks.ru/ It supports small subset of algorithms, but is ok for testing purposes. --

Re: [go-nuts] Any general VPN(pptp, l2tp, openVPN, IPSec VPN) server implementation in go?

2020-11-17 Thread Daniel Moch
> Hi, I want to use a general VPN protocols to comminucate with my server, we > cannot change the client to use other VPN protocols. > But I did a lot of research, it seems there is no go implementation for the > general VPN. > > I really want that I'm wrong, so do any guys can give me some

Re: [go-nuts] Re: How does the Golang compiler handle dependencies?

2020-11-17 Thread Haddock
Here is an article by Walter Bright that explains what the C++ compiler is doing: https://www.digitalmars.com/articles/b54.htm l Walter Bright is the creator of the first C++ compiler (if I remember right this was the Zortech C++ compiler, later

Re: [go-nuts] Heap allocation found in function prolog

2020-11-17 Thread 'ju...@sqreen.com' via golang-nuts
Thanks for the hints, I could finally have a look at it and found that a uint64 value was escaping regardless of the actual function code path. I can reproduce it with this dummy function example: func foo(cond bool, v int) *int { if cond { return } return nil } The

[go-nuts] arangodb go-client and an interface field in the struct

2020-11-17 Thread sbezv...@cisco.com
Hello, I was wondering if somebody had experience storing a struct in arangodb using arangodb go client when the struct was carrying some fields as interfaces. Would it be sufficient to provide MarshalJSON/UnmarshalJSON dealing with the interface type field? Appreciate any feedback Thank you

Re: [go-nuts] gollvm: Issues on Alpine linux. Tentative definition has type 'struct sigstack' that is never completed, in sysinfo.c

2020-11-17 Thread 'Than McIntosh' via golang-nuts
> /home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/gofrontend/libgo/sysinfo.c:462:1: error: tentative definition has type 'struct sigstack' that is never completed > SREF(sigstack); > ^ I don't know why sysinfo.c has the line "SREF(sigstack)". What happens if you just remove it? I

Re: [go-nuts] How to detect HTTP client stop polling at the server side

2020-11-17 Thread Shulhan
Hi Afriyie, Looks like you almost there ;) > On 17 Nov 2020, at 20.11, Afriyie Abraham Kwabena > wrote: > > HI, > > This is what I have tried so far but am not able to get the time difference > in seconds. I mean the time differences between the time stored in the > map[string]time.Time

Re: [go-nuts] How to detect HTTP client stop polling at the server side

2020-11-17 Thread Afriyie Abraham Kwabena
HI, This is what I have tried so far but am not able to get the time difference in seconds. I mean the time differences between the time stored in the map[string]time.Time and the current time in seconds. code: type Server struct { idtime map[string]time.Time } var my = Server{} func

Re: [go-nuts] Any general VPN(pptp, l2tp, openVPN, IPSec VPN) server implementation in go?

2020-11-17 Thread Mohamed Yousif
How about wireguard[1]? [1]: https://git.zx2c4.com/wireguard-go/about/ On Tue, 17 Nov 2020, 12:34 pm Nathan, wrote: > Hi, I want to use a general VPN protocols to comminucate with my server, > we cannot change the client to use other VPN protocols. > But I did a lot of research, it seems there

[go-nuts] Any general VPN(pptp, l2tp, openVPN, IPSec VPN) server implementation in go?

2020-11-17 Thread Nathan
Hi, I want to use a general VPN protocols to comminucate with my server, we cannot change the client to use other VPN protocols. But I did a lot of research, it seems there is no go implementation for the general VPN. I really want that I'm wrong, so do any guys can give me some suggestion?

[go-nuts] gopls reports "Error loading workspace folders" for every project I have

2020-11-17 Thread Johann Höchtl
I updated to gopls version golang.org/x/tools/gopls v0.5.3 golang.org/x/tools/gopls@v0.5.3 h1:C8QSrqjqaVzlVoHL1R9yWbROoOApRgI8gN1G+cHlPuw= Since then my vim-go plugin but also if I disable vim-go and use vims native lsp-configuration reports Error loading workspace folders (expected 1,

[go-nuts] WebAssembly and Goroutines

2020-11-17 Thread W. Michael Petullo
I am having trouble understanding the model for Goroutines within WebAssembly. I have a "click" callback with the following form: errChan := make(chan error, 1) go func() { // Call http.PostForm and read response. if err != nil {

Re: [go-nuts] How to detect HTTP client stop polling at the server side

2020-11-17 Thread Anderson Queiroz
Just one thing to keep in mind. Likely you have more than one serve instance running to process the requests. Thus it might happen the client will poll a different server on every request. Just imagine you have servers A, B, C behind a load balance and the domain example.com. As the client is