[go-nuts] Re: go tip: random high CPU usage on VirtualBox

2020-03-11 Thread Mhd Shulhan
> My question is any one have idea how to debug this so I can provide more > detailed report? > > Thank you in advance. So, I try to debug with gdb 9.1. Here is the sample of stack when the CPU got high, ... [New LWP 1885] [New LWP 1886] [New LWP 1887] [New LWP 1888] [New LWP 1889] ^C Thread

Re: [go-nuts] Consume RESTful API Endpoints within a golang application with webtoken

2020-03-11 Thread 'Benjamin' via golang-nuts
Easy, Store the expired time in the token, and hash them. When the expired time almost reach, use the old token to get a new token. > On Mar 12, 2020, at 09:25, Renato Marcandier > wrote: > > Hello guys, > do you have any HelloWorld project in GO using RESTful to issue HTTP requests > from wi

[go-nuts] Consume RESTful API Endpoints within a golang application with webtoken

2020-03-11 Thread Renato Marcandier
Hello guys, do you have any HelloWorld project in GO using RESTful to issue HTTP requests from within a Golang application to remote RESTful/API with web token that expires every 60 minutes and then consume any data that is returned? I am trying to get a simple HelloWorld. First, I need to do a P

Re: [go-nuts] Does recent bug in debug.FreeOSMemory also affect automatic background scavenging?

2020-03-11 Thread johnmrusk
Thanks Michael, That's super-helpful in helping us understand what to look for, and what not to look for. I can't easily get sufficient data to file an issue right now, because the behaviour has only been reported in a customer environment that I don't have access to. For that reason I can'

Re: [go-nuts] Does recent bug in debug.FreeOSMemory also affect automatic background scavenging?

2020-03-11 Thread 'Michael Knyszek' via golang-nuts
Hi John, If you're referring to scavenging that kicked in every 2.5 minutes and returned spans which had been unused for 5 minutes, that's been replaced with an asynchronous, continuous mechanism as of Go 1.13 ( https://github.com/golang/go/issues/30333). This policy is generally more aggressive t

Re: [go-nuts] Is this code in package unix assuming machine endianess?

2020-03-11 Thread Rob Pike
More context, in the form of self-promotion: https://commandcenter.blogspot.com/2012/04/byte-order-fallacy.html -rob On Wed, Mar 11, 2020 at 9:42 PM Tom Parkin wrote: > On Tue, 10 Mar 2020 at 23:14, Ian Lance Taylor wrote: > >> On Tue, Mar 10, 2020 at 4:03 PM Tom Parkin wrote: >> > >> > I'm

Re: [go-nuts] SFTPGo: a Golang performance story and some questions

2020-03-11 Thread Ian Lance Taylor
On Wed, Mar 11, 2020 at 6:44 AM 'Benjamin' via golang-nuts wrote: > > Why not merge https://go-review.googlesource.com/c/go/+/51670 since 2017? > I tell you the truth: Workers of commercial companies dislike the community > pull request, this will wast their free time or vacation time. They only

Re: [go-nuts] SFTPGo: a Golang performance story and some questions

2020-03-11 Thread Adrian Ratnapala
BTW: Thanks for all this investigation and writeups, they are interesting, and I look forward to your test results. Desipte my question, I think using a custom allocator is perfectly reasonable. go/issues/23199 is showing us that sync.Pool's interface isn't great for allocating byte-bufffers (it'

Re: [go-nuts] Does recent bug in debug.FreeOSMemory also affect automatic background scavenging?

2020-03-11 Thread Ian Lance Taylor
[ +mknyszek ] On Wed, Mar 11, 2020 at 4:35 PM wrote: > > I see this bug was recently fixed in FreeOSMemory: > https://go-review.googlesource.com/c/go/+/208960/ > > Does the same bug also affect the scavenging that automatically happens every > 5 minutes? Asking because we are seeing high memor

[go-nuts] Using modules with private repos

2020-03-11 Thread 'Bryan C. Mills' via golang-nuts
The protocol described in https://golang.org/cmd/go/#hdr-Remote_import_paths allows you to serve any repo URL for any import path that begins with your server's domain name. You can use basic auth with such a server via credentials stored in a .netrc file, which also works with git. -- You re

Re: [go-nuts] SFTPGo: a Golang performance story and some questions

2020-03-11 Thread Adrian Ratnapala
> > > > Any particular reason you avoided something like sync.Pool ? It could be useful in your case, allocation pattern depending. > > > Hi, > > I initially evaluated the sync.Pool then I read this article: > > https://dzone.com/articles/memory-pooling-in-go-where-why-and-how > > and this issue

[go-nuts] FTE Remote Golang opportunity

2020-03-11 Thread Dirk Zondag, Jr.
Hello group- I am working with an early stage startup looking for a Sr Distributed Systems SW Engineer. The office is in SF, but remote is AOK as well. You would be one of the first 10 people on board developing a groundbreaking serverless cloud and infrastructure. Main strengths needed being

Re: [go-nuts] SFTPGo: a Golang performance story and some questions

2020-03-11 Thread Nicola Murino
Il 11/03/20 22:55, Adrian Ratnapala ha scritto: > > > > Any particular reason you avoided something like sync.Pool ? It could be useful in your case, allocation pattern depending. > > >  Hi, > >  I initially evaluated the sync.Pool then I read this article: > > https://dzone.com/articles/memory

[go-nuts] Does recent bug in debug.FreeOSMemory also affect automatic background scavenging?

2020-03-11 Thread johnmrusk
I see this bug was recently fixed in FreeOSMemory: https://go-review.googlesource.com/c/go/+/208960/ Does the same bug also affect the scavenging that automatically happens every 5 minutes? Asking because we are seeing high memory usage, in an app that has (until now) avoided calling FreeOSMem

Re: [go-nuts] Using modules with private repos

2020-03-11 Thread Marcin Romaszewicz
There is really no nicer way. You do not have to make those .insteadOf overrides in your global git config, though, you can do it in the local git config for your Go repository to contain the damage. You will also find that private repositories don't work nicely with things like the Athens module p

[go-nuts] Using modules with private repos

2020-03-11 Thread Dean Schulze
The docs for modules assume that you'll be publishing your golang modules (actually a git push) to the few public repos that golang has built in support for. I want to use a private repo, but there doesn't seem to be any docs for that. This post

Re: [go-nuts] Re: Where is the version number for a golang module declared?

2020-03-11 Thread Dean Schulze
Well here's what I get in my module with a single directory with a single file with a single package called lib: $ go install lib can't load package: package lib is not in GOROOT (/home/dean/bin/go1.14.linux-amd64/go/src/lib) If I add the pwd to my GOPATH (the way things worked before modules)

Re: [go-nuts] Re: Where is the version number for a golang module declared?

2020-03-11 Thread 'Bryan C. Mills' via golang-nuts
`go install` does the same thing that it always has: it installs compiled binaries and object files, not module source code. (A module may contain multiple packages and multiple binaries.) See https://blog.golang.org/using-go-modules for a higher-level introduction, and note that https://golang.or

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

2020-03-11 Thread Scott Pakin
Thanks for the links and summaries. I had actually seen a few of those pages before. The plasma demonstration at least provides some empirical evidence that as hacky as it is to convert binary→base-64 ASCII→binary for every frame update, the actual performance isn't too terrible. On Wednesday

[go-nuts] Re: Where is the version number for a golang module declared?

2020-03-11 Thread Dean Schulze
Well, that was going to be my next question (how do I install a module from a local git repo or directory). If I understand you correctly go modules require a remote git repo, even if they are used only one machine. That should be made clear in the docs. Modules get cached locally in $GOPATH/p

Re: [go-nuts] Why can't I send byte array to golang TCP server using java netty client?

2020-03-11 Thread wagner riffel
I think that your problem is here: buffer := make([]byte, 6), conn.Read reads up to len(bufer) before unblocking, and apparently you're trying to decode an int32, which is 4 bytes long, so your Read call is waiting for those 2 bytes from your java client to continue. —wagner -- You received this

[go-nuts] Re: Where is the version number for a golang module declared?

2020-03-11 Thread 'Bryan C. Mills' via golang-nuts
On Tuesday, March 10, 2020 at 5:47:45 PM UTC-4 dean.w@gmail.com wrote: > This blog entry uses git > tags. It didn't mention branches. Are tags the only way to declare a > version number? > Yes, tags are the way to declare a version. Generall

[go-nuts] Why can't I send byte array to golang TCP server using java netty client?

2020-03-11 Thread tan winfan
NioEventLoopGroup worker = new NioEventLoopGroup(); bootstrap.group(worker); bootstrap.channel(NioSocketChannel.class); bootstrap.handler(new ChannelInitializer() { @Override protected void initChannel(Channel channel) throws Exception { //BIG_ENDIAN channel.pipeline().addLast(new LengthFie

[go-nuts] I have a question about #gokit and #tracing.

2020-03-11 Thread Mahmood Tehrani
When I use #opentracing in go kit just add in Zipkin or Jaeger one span and time duration whole a request but I wanna have per function one span. Have anybody experience in Gokit and tracing? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] SFTPGo: a Golang performance story and some questions

2020-03-11 Thread Nicola Murino
Il 11/03/20 15:23, Jesper Louis Andersen ha scritto: On Wed, Mar 11, 2020 at 1:43 PM Nicola Murino > wrote: So I wrote a proof of concept allocator that tries to avoid all these extra allocations reusing the previously allocated slices: https://github

Re: [go-nuts] SFTPGo: a Golang performance story and some questions

2020-03-11 Thread Jesper Louis Andersen
On Wed, Mar 11, 2020 at 1:43 PM Nicola Murino wrote: > So I wrote a proof of concept allocator that tries to avoid all these > extra allocations reusing the previously allocated slices: > > https://github.com/drakkan/sftp/blob/master/allocator.go > > Any particular reason you avoided something li

Re: [go-nuts] Add "not null" parameter check and const variables/pointers

2020-03-11 Thread Robert Engels
Thinking about this over morning coffee it is more complex. It is not just sequential consistency that affects it - placing the struct in a map or some other reference container would also have to force a copy. Less and less utility. > On Mar 11, 2020, at 3:33 AM, Robert Engels wrote: > > 

Re: [go-nuts] SFTPGo: a Golang performance story and some questions

2020-03-11 Thread 'Benjamin' via golang-nuts
Why not merge https://go-review.googlesource.com/c/go/+/51670 since 2017? I tell you the truth: Workers of commercial companies dislike the community pull request, this will wast their free time or vacation time. They only worked for capitalists

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

2020-03-11 Thread howardcshaw
I've no relevant experience, but I can recommend a couple of projects to look at in the absence of anyone chiming in with actual experience: https://agniva.me/wasm/2018/06/18/shimmer-wasm.html https://github.com/agnivade/shimmer This is a play-project that involves loading images. It appears to b

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

2020-03-11 Thread Scott Pakin
I'm new to WebAssembly and am trying to get Go to generate a bitmapped image to display in the Web browser. Here's what I've come up with so far: func DrawPicture(this js.Value, args []js.Value) interface{} { // Create a canvas on the Web page. const width = 256 const hei

Re: [go-nuts] SFTPGo: a Golang performance story and some questions

2020-03-11 Thread 'Benjamin' via golang-nuts
I think that’s why go should be driven by the community but not by Bell labs nor Google labs. Works in Bell Labs or Google Labs may leave the job, and may not know everything. But the community have enough Human Resources and various of knowledges. Some scientists and reaserchers worked for c

[go-nuts] SFTPGo: a Golang performance story and some questions

2020-03-11 Thread Nicola Murino
Hi all, I want to share the performances analysis I recently did for SFTPGo, the fully featured and highly configurable SFTP server written in Go (https://github.com/drakkan/sftpgo). When I decided to write an SFTP server I evaluated the available libraries and I did some quick performance tes

[go-nuts] Locked and closed issue 30400 but has it resolved the OPS report?

2020-03-11 Thread Kevin Chadwick
https://github.com/golang/go/issues/30400 It is still not clear without testing for yourself after the commit in the docs that "(before umask)" is referring to using os.umask after file creation or the executors inherited umask (secure reality). The referenced Commit: "https://github.com/golang/g

Re: [go-nuts] Is this code in package unix assuming machine endianess?

2020-03-11 Thread Tom Parkin
On Tue, 10 Mar 2020 at 23:14, Ian Lance Taylor wrote: > On Tue, Mar 10, 2020 at 4:03 PM Tom Parkin wrote: > > > > I'm working on adding a new Linux socket type (L2TPIP) to the unix > package, and I noticed some code in there that appears on the face of it to > be assuming the endianess of the ho

Re: [go-nuts] An important proposal will fail without your support

2020-03-11 Thread Dan Kortschak
Ah, OK. On Wed, 2020-03-11 at 01:58 -0700, miha.vrhov...@gmail.com wrote: > https://github.com/golang/text/pull/9 > > And I cannot find the issue, but there are a few with extract command > not working and crashing. > > On Wednesday, March 11, 2020 at 9:40:36 AM UTC+1, kortschak wrote: > > Why d

Re: [go-nuts] An important proposal will fail without your support

2020-03-11 Thread miha . vrhovnik
https://github.com/golang/text/pull/9 And I cannot find the issue, but there are a few with extract command not working and crashing. On Wednesday, March 11, 2020 at 9:40:36 AM UTC+1, kortschak wrote: > > Why do you say that? > > ~/src/golang.org/x/text/message [master*]$ go env GO111MODULE >

Re: [go-nuts] An important proposal will fail without your support

2020-03-11 Thread Dan Kortschak
Why do you say that? ~/src/golang.org/x/text/message [master*]$ go env GO111MODULE on ~/src/golang.org/x/text/message [master*]$ go version go version go1.14 linux/amd64 ~/src/golang.org/x/text/message [master*]$ go test PASS ok golang.org/x/text/message 0.024s On Wed, 2020-03-11 at

Re: [go-nuts] An important proposal will fail without your support

2020-03-11 Thread miha . vrhovnik
AFAIK this doesn't work in recent go versions and even less if you are using modules. On Wednesday, March 11, 2020 at 6:39:36 AM UTC+1, Tamás Gulácsi wrote: > > Hi Jon, > > Have you read https://godoc.org/golang.org/x/text/message ? > > It's not gettext, but a better - though not perfect - soluti

Re: [go-nuts] An important proposal will fail without your support

2020-03-11 Thread Levieux Michel
Hi Jon, It seems you missed something here. "Please like my proposal or everyone loses" is not an argument. We don't work that way here. You have suggested the language needs a feature, and have gotten many answers from people that think it does not. Keeping on repeating the same argument forever