Re: [go-nuts] if/switch statements as expressions

2018-12-20 Thread Tom Mitchell
On Thu, Dec 20, 2018 at 2:48 PM Michael Jones wrote: > interesting! i wish algol 68 had had its chance. > Well, "It ain't over till it is over." http://algol68.sourceforge.net/ " multiple licenses that should be read carefully: it is open source software, but not all components are fully f

Re: [go-nuts] Go Documentation

2018-12-20 Thread Tom Limoncelli
On Thu, Dec 20, 2018 at 1:27 AM 伊藤和也 wrote: > Are there any teaching materials to learn how to write go documentations? > Are you looking for documents that can be used to learn go? 1. "A Tour of Go" is a good place to start: https://tour.golang.org/welcome/1 2. Many tutorials are here: https:

Re: [go-nuts] Re: go1.12 memory release on Linux

2018-12-20 Thread Ian Lance Taylor
On Thu, Dec 20, 2018 at 2:35 PM aaronb via golang-nuts wrote: > > Thanks for the clarification. The system I am testing on is swapless, so > maybe would explain why RSS is not increasing. >> >> On a swapless system, freeing pages in a given range happens instantly, >> regardless of memory pressu

Re: [go-nuts] Go 1.12 Beta 1 is released

2018-12-20 Thread Ian Lance Taylor
On Thu, Dec 20, 2018 at 2:32 PM Peter Kleiweg wrote: > > Ian Lance Taylor schreef op 20 december 2018 23:10:17 CET: > > On Thu, Dec 20, 2018 at 10:58 AM Peter Kleiweg > > wrote: > > > > > > Ian Lance Taylor schreef op 20 december 2018 > > 19:20:13 CET: > > > > Adding the file with the local con

Re: [go-nuts] if/switch statements as expressions

2018-12-20 Thread Michael Jones
interesting! i wish algol 68 had had its chance. On Thu, Dec 20, 2018 at 2:40 PM Bakul Shah wrote: > On Thu, 20 Dec 2018 13:13:04 -0800 Michael Jones > wrote: > > > > There is an inelegant but highly effective "hack" in GCC/G++ in thuas > area. > > Since C/C++ are expression language as Rob put

Re: [go-nuts] if/switch statements as expressions

2018-12-20 Thread Bakul Shah
On Thu, 20 Dec 2018 13:13:04 -0800 Michael Jones wrote: > > There is an inelegant but highly effective "hack" in GCC/G++ in thuas area. > Since C/C++ are expression language as Rob put it (e.g. a statement like > "3" compiles where in Go it fails with "3 evaluated but not used") GCC took > this a

Re: [go-nuts] Re: go1.12 memory release on Linux

2018-12-20 Thread aaronb via golang-nuts
Thanks for the clarification. The system I am testing on is swapless, so maybe would explain why RSS is not increasing. > On a swapless system, freeing pages in a given range happens instantly, > regardless of memory pressure. > My suggestion for wording would to be more specific about the de

Re: [go-nuts] Go 1.12 Beta 1 is released

2018-12-20 Thread Peter Kleiweg
Ian Lance Taylor schreef op 20 december 2018 23:10:17 CET: > On Thu, Dec 20, 2018 at 10:58 AM Peter Kleiweg > wrote: > > > > Ian Lance Taylor schreef op 20 december 2018 > 19:20:13 CET: > > > Adding the file with the local configuration should work just as > well > > > when you need to adjust pk

Re: [go-nuts] Re: go1.12 memory release on Linux

2018-12-20 Thread Ian Lance Taylor
On Thu, Dec 20, 2018 at 2:13 PM wrote: > > The wording is kinda bad. All it means is that the runtime was updated to use > MADV_FREE instead of MADV_DONTNEED if possible. > > You can read about the difference on the madvise(2) man page, but basically > MADV_FREE is more lazy. There is no actual

[go-nuts] Re: go1.12 memory release on Linux

2018-12-20 Thread nuss . justin
The wording is kinda bad. All it means is that the runtime was updated to use MADV_FREE instead of MADV_DONTNEED if possible. You can read about the difference on the madvise(2) man page, but basically MADV_FREE is more lazy. There is no actual impact other than the RSS value being not as accur

Re: [go-nuts] Go 1.12 Beta 1 is released

2018-12-20 Thread Ian Lance Taylor
On Thu, Dec 20, 2018 at 10:58 AM Peter Kleiweg wrote: > > Ian Lance Taylor schreef op 20 december 2018 19:20:13 CET: > > On Thu, Dec 20, 2018 at 8:02 AM Peter Kleiweg > > wrote: > > > > > > Ian Lance Taylor schreef op 20 december 2018 > > 16:47:20 CET: > > > > On Thu, Dec 20, 2018 at 1:07 AM Pe

Re: [go-nuts] Go 1.12 Beta 1 is released

2018-12-20 Thread Wojciech S. Czarnecki
On Thu, 20 Dec 2018 19:58:15 +0100 Peter Kleiweg wrote: > I don't need make. A simple script will do. > Or rather, it should. I can install the packages, > but I can't import them because Go is too limited > to remember the necessary environment settings. You said you use a wrapper script aroun

Re: [go-nuts] if/switch statements as expressions

2018-12-20 Thread Michael Jones
There is an inelegant but highly effective "hack" in GCC/G++ in thuas area. Since C/C++ are expression language as Rob put it (e.g. a statement like "3" compiles where in Go it fails with "3 evaluated but not used") GCC took this a step further and implemented that the last expression evaluated in

[go-nuts] Re: go1.12 memory release on Linux

2018-12-20 Thread aaronb via golang-nuts
I'm trying out a build of my code under go1.12beta1 and resident memory usage is not too dramatically different than under go1.11. The wording on this release note made me think the runtime was going to continually gobble up memory and not release any until the system had nearly run out, but tha

[go-nuts] Re: go1.11.4.windows-amd64.zip not downloading...

2018-12-20 Thread Trig
On Thursday, December 20, 2018 at 2:11:59 PM UTC-6, Trig wrote: > > Is anybody able to successfully download from this link? All other > platforms/versions appear to work... just this one isn't doing anything for > me. > > https://golang.org/doc/install?download=go1.11.4.windows-amd64.zip > I

[go-nuts] go1.11.4.windows-amd64.zip not downloading...

2018-12-20 Thread Trig
Is anybody able to successfully download from this link? All other platforms/versions appear to work... just this one isn't doing anything for me. https://golang.org/doc/install?download=go1.11.4.windows-amd64.zip -- You received this message because you are subscribed to the Google Groups "

Re: [go-nuts] performance optimization

2018-12-20 Thread robert engels
I updated the github issue with some additional performance comparisons and notes. I think there are some pretty trivial solutions for high frequency pollers, at least those using time.Sleep() > On Dec 19, 2018, at 10:03 PM, Robert Engels wrote: > > Then something is broken on the implementat

[go-nuts] Re: Best practices for using methods on types to write SQL

2018-12-20 Thread eric via golang-nuts
On Thursday, December 20, 2018 at 7:23:22 AM UTC-8, Nick wrote: > > Hi all, > > I'm newish to Go, and I've been really enjoying using it. I'm still > getting to grips with the best practices of the language. > > Up until now, I've used MarshalJSON methods on complex struct types > to easily s

[go-nuts] go1.12 memory release on Linux

2018-12-20 Thread aaronb via golang-nuts
Hello, This caught my eye from the go1.12beta1 release notes: On Linux, the Go runtime now releases memory back to the operating system > only when the OS is under memory pressure. This is more efficient, but > means a process's RSS (resident set size) won't decrease unless the OS is > running

Re: [go-nuts] Go 1.12 Beta 1 is released

2018-12-20 Thread Peter Kleiweg
Ian Lance Taylor schreef op 20 december 2018 19:20:13 CET: > On Thu, Dec 20, 2018 at 8:02 AM Peter Kleiweg > wrote: > > > > Ian Lance Taylor schreef op 20 december 2018 > 16:47:20 CET: > > > On Thu, Dec 20, 2018 at 1:07 AM Peter Kleiweg > > > wrote: > > > > > > > > Ian Lance Taylor schreef op

Re: [go-nuts] Go 1.12 Beta 1 is released

2018-12-20 Thread Ian Lance Taylor
On Thu, Dec 20, 2018 at 8:02 AM Peter Kleiweg wrote: > > Ian Lance Taylor schreef op 20 december 2018 16:47:20 CET: > > On Thu, Dec 20, 2018 at 1:07 AM Peter Kleiweg > > wrote: > > > > > > Ian Lance Taylor schreef op 20 december 2018 > > 00:06:58 CET: > > > > > > > How about this: > > > > > > >

Re: [go-nuts] a question about go

2018-12-20 Thread Jan Mercl
Because 3.0 == 3 and the documentation for the fmt package says the default verb (%v) for floats prints only so much digits as needed, which also implies training zeros will be dropped until explicitly asked for by a different formatting verb, like %f3.1, for example. On Thu, Dec 20, 2018, 18:29 J

[go-nuts] a question about go

2018-12-20 Thread Jiaye Tang
This is the code I find when I read the a book about Golang. I have a question why the result is 1,2,3,4 instead of 1, 2, 3.0 and 4.0 when bx and by are float. Could anyone help me? Thanks a lot! [image: Screen Shot 2018-12-20 at 11.59.07 PM.png] -- You received this message because you are

Re: [go-nuts] Go 1.12 Beta 1 is released

2018-12-20 Thread Peter Kleiweg
Ian Lance Taylor schreef op 20 december 2018 16:47:20 CET: > On Thu, Dec 20, 2018 at 1:07 AM Peter Kleiweg > wrote: > > > > Ian Lance Taylor schreef op 20 december 2018 > 00:06:58 CET: > > > > > How about this: > > > > > > Move the C files to a subdirectory. Write a script or Makefile > that >

Re: [go-nuts] Go 1.12 Beta 1 is released

2018-12-20 Thread Ian Lance Taylor
On Thu, Dec 20, 2018 at 1:07 AM Peter Kleiweg wrote: > > Ian Lance Taylor schreef op 20 december 2018 00:06:58 CET: > > > How about this: > > > > Move the C files to a subdirectory. Write a script or Makefile that > > compiles the C files into a .syso file in the main package directory, > > usin

[go-nuts] Best practices for using methods on types to write SQL

2018-12-20 Thread Nick
Hi all, I'm newish to Go, and I've been really enjoying using it. I'm still getting to grips with the best practices of the language. Up until now, I've used MarshalJSON methods on complex struct types to easily save the state of data, using Marshal() from encoding/json. This has worked reall

[go-nuts] RedisPipe - high throughput Redis connector

2018-12-20 Thread Sokolov Yura
Good day, everyone We at Joom use Redis a lot for caching and volatile storage and wish to do it as efficiently as possible. It is well known than pipelining could be used for maximum performance. But explicit pipelining is not often comfortable to use, more

Re: [go-nuts] Re: performance optimization

2018-12-20 Thread Tamás Király
the implementation with time.Ticker for me use stably under 20% CPU, i guess this is the best i can get without syscall or CGO magic https://play.golang.org/p/Q5BMpr6zCEF interesting fact that for me time.Sleep was the least performant while github issue states the opposite Robert Engels ezt

Re: [go-nuts] Go 1.12 Beta 1 is released

2018-12-20 Thread Peter Kleiweg
Ian Lance Taylor schreef op 20 december 2018 00:06:58 CET: > How about this: > > Move the C files to a subdirectory. Write a script or Makefile that > compiles the C files into a .syso file in the main package directory, > using flags that you specify. Fetch the package using `go get -d`. > Ru

[go-nuts] tool to automatically refresh godoc ?

2018-12-20 Thread Sebastien Binet
hi there, in all my Go-based projects I have a bunch of CI/CD tools that keep me honest about APIs, tests, coverage and what not. but it happens from time to time that I either break an API and/or add a new field, a new function a new type, etc... and it has happened also a few times that one of

Re: [go-nuts] GO build can't find package - Need help!!

2018-12-20 Thread Sebastien Binet
On Thu, Dec 20, 2018 at 4:48 AM Bhoompally Manipal wrote: > New to go...trying to build go project using "go build main.go" fails > with the below error. verified the $GOPATH (C:\Users\mbhoompa\go) and > $GOROOT (C:\Go). Looks like its trying to append $GOPATH twice..any > thoughts? > just run