Re: [go-nuts] Re: pkg.go.dev: redirect URL for latest major version or big red warning for old version

2024-04-08 Thread Tom Payne
s. Alternatively, this banner should be in big red >> letters - if you're using this version of the module then you're probably >> doing something wrong. >> >> If there's support for this new URL and/or the banner usability >> improvement, then I'd be happy

[go-nuts] Alternative text/template function libraries to github.com/Masterminds/sprig?

2023-01-09 Thread Tom Payne
roject, are there any existing good existing alternatives to Masterminds/sprig? Many thanks, Tom -- 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 gola

Re: [go-nuts] Go and GPUs

2021-06-25 Thread Tom Mitchell
As others have said, lots of secret sauce which includes the instruction set for the function blocks in silicon. Thus there is no assembler for the compiler that generates the code. Other chunks of the necessary tool chain are also absent or homegrown (no document other than source). The best

Re: [go-nuts] time.Format with "Month Year" format incorrectly displayed

2021-05-11 Thread Tom Limoncelli
at already know how it works. Tom -- Email: t...@whatexit.orgWork: tlimonce...@stackoverflow.com Blog: http://EverythingSysadmin.com/ -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop recei

[go-nuts] no matching versions for query "latest"

2021-04-12 Thread Tom Limoncelli
o mod tidy` but that's not a great solution. Any suggestions of how to fix this or even how to go about researching it? Thanks! Tom -- Blog: https://www.yesthatblog.com/ -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

[go-nuts] Golang mentioned on Penn and Teller: Fool Us?

2021-03-04 Thread Tom Limoncelli
a portrait of him. For those that don't know... Rene French created the Go logo. https://blog.golang.org/gopher It felt like a non sequitur for him to mention it but my face lit up and he did. Tom -- Email: t...@whatexit.orgWork: tlimonce...@stackoverflow.com Blog: http://EverythingSysadmin.com

Re: [go-nuts] Re: Unable to find small memory leak

2021-02-11 Thread Tom Mitchell
On Thu, Feb 11, 2021 at 3:40 AM Uli Kunitz wrote: > You are writing: The device crashes with out of memory. What does crash? > The Go program, another program or the kernel? Can you share the error > message? Can you share the log file for one day of GODEBUG=gctrace=1? > > In bash do: > > $

[go-nuts] WMI and Go... where to get started?

2021-02-07 Thread Tom Limoncelli
ns/dns-wmi-provider-samples-managing-dns-resource-records) Can anyone point me in the right direction? What are the best resources for learning WMI in general? Thanks in advance! Tom -- You received this message because you are subscribed to the Google Groups "golang-nuts" group.

Re: [go-nuts] x, err = some_func(); if err != nil { } seems awkward

2020-06-14 Thread Tom Limoncelli
Great minds think alike! On Sun, Jun 14, 2020 at 12:56 PM Ian Lance Taylor wrote: > > On Sun, Jun 14, 2020 at 8:25 AM Tom Limoncelli wrote: > > > > On Thu, Jun 4, 2020 at 3:34 PM Ian Lance Taylor wrote: > > > > > > On Thu, Jun 4, 2020 at 8:43 AM wrote:

Re: [go-nuts] x, err = some_func(); if err != nil { } seems awkward

2020-06-14 Thread Tom Limoncelli
;, pathc, err) } This is half as many lines, thus makes it easier to fit on one screenful of an editor, which is often a cognitive limit for a developer. I'm not saying that this solves the problem, but I bet it would reduce the pressure to fix it. Tom -- Email: t...@whatexi

Re: [go-nuts] Go has eliminated most of my off-by-one errors except 0... I mean 1.

2020-06-14 Thread Tom Limoncelli
ful for when showing intent is more important than performance. Feedback on the module would be greatly appreciated! If you use the module, I'd love to know if you felt it reduced your off-by-one errors (or the potential for them). Best, Tom On Sat, Jun 13, 2020 at 1:09 PM Jan Mercl <0xj...@gmail

[go-nuts] Go has eliminated most of my off-by-one errors except 0... I mean 1.

2020-06-13 Thread Tom Limoncelli
at said, I think highest() (or maybe end(), ultimate()? final(), hind()?) would be a great human-centric feature to add. Tom WIth better formatting... https://www.yesthatblog.com/post/0068-go-off-by-one -- Email: t...@whatexit.orgWork: tlimonce...@stackoverflow.com Twitter: YesThatTom Blog:

Re: [go-nuts] Re: C to Go calls taking a long time - is this cgo overhead or my mistake?

2020-05-31 Thread Tom Larsen
t, May 30, 2020, 6:08 PM Tom Larsen > wrote: > >> I've managed to batch the incoming data, so I thought I would provide an >> update: >> >> Batching 10 records at a time reduced runtime to just under 40 seconds >> (beating Python!), so the slowdown I am seeing

[go-nuts] Re: C to Go calls taking a long time - is this cgo overhead or my mistake?

2020-05-30 Thread Tom Larsen
. On Wednesday, May 27, 2020 at 1:08:17 PM UTC-4, Tom Larsen wrote: > > I am attempting to build a Golang SDK for the Alteryx analytic > application. Alteryx provides a C API for interacting with the engine, so > I thought I would use cgo to build a bridge between Alteryx and Go. > &

Re: [go-nuts] C to Go calls taking a long time - is this cgo overhead or my mistake?

2020-05-27 Thread Tom Larsen
the execution if my issue truly is cgo overhead. Tom On Wednesday, May 27, 2020 at 6:44:18 PM UTC-4, Ian Lance Taylor wrote: > > On Wed, May 27, 2020 at 10:08 AM Tom Larsen > wrote: > > > > I am attempting to build a Golang SDK for the Alteryx analytic > application.

[go-nuts] C to Go calls taking a long time - is this cgo overhead or my mistake?

2020-05-27 Thread Tom Larsen
I am attempting to build a Golang SDK for the Alteryx analytic application. Alteryx provides a C API for interacting with the engine, so I thought I would use cgo to build a bridge between Alteryx and Go. The basic flow-of-control looks something like this: 1. The engine pushes a record of

[go-nuts] Getting cross-package test coverage data?

2020-05-13 Thread Tom Payne
. Is this correct? Many thanks, Tom -- 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 this discussion on the web vi

Re: [go-nuts] Re: marshal multiple json documents which may have different format versions into the latest struct version

2020-05-01 Thread Tom Payne
st decoding into a struct only the Version field is better though, especially when combined with Go's runtime type switches. Regards, Tom On Wednesday, April 29, 2020 at 9:31:00 AM UTC+1, Chris Burkert wrote: > > That sounds like a good plan. I'm going to try that. Thank you Manlio! > >

Re: [go-nuts] testing code that uses ioutil.ReadDir?

2020-04-11 Thread Tom Payne
t.Errorf("expected error from ReadDir") } } func TestX(t *testing.T) { fs, cleanup, err := vfst.NewTestFS(nil) if err != nil { t.Fatal(err) } defer cleanup() testReadDirFailer(t, readDirFailer{FS: fs}) } HTH, Tom On Saturday, April 11, 2020 at 12:16:30 AM UTC+1, Ian Lance Taylor wrote

[go-nuts] When to use runtime.GOOS vs. build flags/file suffixes?

2020-04-08 Thread Tom Payne
S-specific code is so different that it really deserves to be in a separate source file. Is this recommendation reasonable? What could be improved? Cheers, Tom -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] Recommended way to prevent my project being built with an old Go version?

2020-04-07 Thread Tom Payne
at exactly the minimum Go version that you want. On Thursday, April 2, 2020 at 1:26:04 AM UTC+1, Tom Payne wrote: > > Thanks Ian for the fast and authoritative answer. I'll do what you suggest. > > Cheers, > Tom > > On Tuesday, March 31, 2020 at 2:31:19 AM UTC+1, Ian Lance Taylor wro

Re: [go-nuts] Recommended way to prevent my project being built with an old Go version?

2020-04-01 Thread Tom Payne
Thanks Ian for the fast and authoritative answer. I'll do what you suggest. Cheers, Tom On Tuesday, March 31, 2020 at 2:31:19 AM UTC+1, Ian Lance Taylor wrote: > > On Mon, Mar 30, 2020 at 6:22 PM Tom Payne > > wrote: > > > > Go's backwards compatibility guarante

[go-nuts] Recommended way to prevent my project being built with an old Go version?

2020-03-30 Thread Tom Payne
y to ensure a minimum Go version at build time? One of the above suggestions or another way? Many thanks, Tom -- 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

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

2020-03-12 Thread Tom Parkin
01:33, Rob Pike wrote: > 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: &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 a

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

2020-03-10 Thread Tom Parkin
machine. It seems as though this code would do the wrong thing on a big-endian machine. Can anyone suggest what I'm missing here? Is this code really assuming that the host is a little-endian machine? Thanks! Tom -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] keep just 2 decimal places in a float64

2020-02-23 Thread Tom Mitchell
On Sat, Feb 22, 2020 at 1:06 PM 'simon place' via golang-nuts < golang-nuts@googlegroups.com> wrote: > are you sure? > > surely floats can have, say, a small number added, that depending of the > value, sometimes doesn't change them and sometimes does. seems to me the > same issue. > > On

[go-nuts] Re: Experience report on a large Python-to-Go translation

2020-01-26 Thread Tom Payne
Really interesting post, thank you. On iterators without leaking goroutines, have a look at the standard library's bufio.Scanner and database/sql.Rows. These provide easy iteration over arbitrary sequences in a compact idiomatic form. -- You received this message because you are subscribed to

Re: [go-nuts] Unexpected evaluation order in a return statement with multiple operands

2020-01-15 Thread Tom Payne
: > On Wed, Jan 15, 2020 at 12:24 PM Tom Payne wrote: > > > > Thanks all for the insight and explanation. Could I suggest tweaking the > Go language specification to emphasize the separation, so it reads: > > > >"when evaluating the operands of an expression

Re: [go-nuts] Unexpected evaluation order in a return statement with multiple operands

2020-01-15 Thread Tom Payne
Thanks all for the insight and explanation. Could I suggest tweaking the Go language specification to emphasize the separation, so it reads: "when evaluating the operands of an expression, assignment, or return statement, *then* all function calls, method calls, and communication operations

[go-nuts] Unexpected evaluation order in a return statement with multiple operands

2020-01-15 Thread Tom Payne
what's actually happening here? Can I rely on this behavior or might it change in future versions of Go? Cheers, Tom -- 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 a

Re: [go-nuts] Existing hermetic end-to-end testing libraries for CLI applications?

2020-01-10 Thread Tom Payne
Many thanks for this Paul - this is exactly what I was looking for. Cheers, Tom On Fri, 10 Jan 2020 at 09:55, Paul Jolly wrote: > Hi Tom, > > > tl;dr Are there any existing end-to-end testing libraries for CLI > applications? Specifically, what I'm looking for is a library that

[go-nuts] Existing hermetic end-to-end testing libraries for CLI applications?

2020-01-09 Thread Tom Payne
test which is fantastic for writing integration tests with third-party services but not set up for testing your own applications. Do you know of any existing libraries that implement this sort of functionality? Many thanks, Tom -- You received this message because you are subscribed to the Goo

Re: [go-nuts] regexp syntax and named Unicode character classes

2020-01-07 Thread Tom Payne
Thank you :) Is this worth adding to the regexp/syntax documentation? I'd happily contribute a patch. On Tuesday, January 7, 2020 at 7:36:02 PM UTC+1, Ian Lance Taylor wrote: > > On Tue, Jan 7, 2020 at 10:22 AM Tom Payne > > wrote: > > > > tl;dr How should I use

[go-nuts] regexp syntax and named Unicode character classes

2020-01-07 Thread Tom Payne
ITTbqvom9F>. Is this simply an oversight that Unicode character classes like "Letter" and "Number, decimal digit" are not available for use in regexps, or should I be using them differently? Many thanks, Tom -- You received this message because you are subscribed to the Go

[go-nuts] [ANN] go-jsonstruct: generate Go structs from multiple JSON objects

2019-12-16 Thread Tom Payne
, or a document dump from CouchDB or MongoDB. You get back the most-specific Go type that you can unmarshall all the observed values into with encoding/json. https://github.com/twpayne/go-jsonstruct Feedback and improvements welcome :) Tom -- You received this message because you are subscribed

Re: [go-nuts] Automatically releasing memory resources allocated in cgo?

2019-11-01 Thread Tom Payne
Thank you very much for the fast, clear, and detailed answer :) On Fri, 1 Nov 2019 at 15:08, Ian Lance Taylor wrote: > On Fri, Nov 1, 2019 at 6:31 AM Tom Payne wrote: > > > > cgo is often used to provide bindings to C libraries. Any memory > allocated in the C library is not

[go-nuts] Automatically releasing memory resources allocated in cgo?

2019-11-01 Thread Tom Payne
any server code. Are there any good options? Cheers, Tom -- 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 t

[go-nuts] A better io.Reader.Read signature?

2019-09-05 Thread Tom Payne
method? I am not suggesting that we change io.Reader (that would break everything!), just looking for input into good Go API design. This would be a comment on Dave's fantastic blog, but the blog does not have comment functionality, so I'm asking here, and I know that Dave lurks here too. Cheer

[go-nuts] Existing production-ready libraries for parallelizing HTTP requests?

2019-08-19 Thread tom via golang-nuts
awling web pages. Do you know of any such library? Many thanks, Tom -- Confidentiality Notice: This electronic message and any attached documents contain confidential and privileged information and is for the sole use of the individual or entity to whom it is addressed. If you are no

Re: [go-nuts] prevent alteration of binaries once distributed in the wild?

2019-07-23 Thread Tom Mitchell
On Tue, Jul 23, 2019 at 11:51 AM clement auger wrote: > Hi, > > I m looking for a technique to prevent binary alteration once distributed > in the wild. > > I have no clue what i m asking for. > The best current solutions are package manager oriented. Decide on the platform you want to work on

Re: [go-nuts] OOM occurring with a small heap

2019-07-03 Thread Tom Mitchell
On Mon, Jul 1, 2019 at 12:42 PM 'Yunchi Luo' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Hello, I'd like to solicit some help with a weird GC issue we are seeing. > > I'm trying to debug OOM on a service we are running in k8s. The service is > just a CRUD server hitting a database

Re: [go-nuts] Re: godoc memory leak

2019-06-20 Thread Tom Mitchell
me memory until it surpasses the memory on the > machine and crashes. After the crash, the other processes on my machine > continue to work and the memory is freed back entirely to the machine. > > On Thu, Jun 20, 2019 at 11:10 AM Tom Mitchell wrote: > >> >> On Mon

Re: [go-nuts] Re: godoc memory leak

2019-06-20 Thread Tom Mitchell
On Mon, Jun 17, 2019 at 9:40 PM Agniva De Sarker < agniva.quicksil...@gmail.com> wrote: > Couple of questions: > > 1. What version of godoc and Go are you using ? What is your go env ? > >> One other question ... If the OS supports limits does godoc fail nicely with smaller limits. I am reminded

Re: [go-nuts] Cross-Compile Windows 10 -> FreeBSD

2019-06-12 Thread Tom Mitchell
Try a VMWARE virtual machine. Install a FreeBSD distro and as long as the hardware (CPU) is the same you should be good. Even targeting a different hardware platform might be easier inside a VM. Inside the VM you can save temp files and capture compiler, assembler and linker settings to Chip away

Re: [go-nuts] Interesting public commentary on Go...

2019-05-23 Thread Tom Mitchell
This makes a bit of sense from the Google point of view. The central nut of a language under development is something that needs to be well managed. I have seen this with Modula-2 in the past as well as C++. Niklaus Wirth declined blessing a standard library for Modula-2 perhaps killing it as a

Re: [go-nuts] Re: built-in alternative to bcrypt?

2019-04-22 Thread Tom Mitchell
On Mon, Apr 22, 2019 at 1:18 PM whitehexagon via golang-nuts < golang-nuts@googlegroups.com> wrote: > Thanks everyone, plenty more reading for me! > > The argon2 looks interesting, but it sounds like it could be very memory > heavy. The code I'm porting is running on a PAAS/SAAS setup, and

Re: [go-nuts] Re: Disable test result caching from within Go code?

2019-04-12 Thread Tom Payne
applies to the whole set of tests >> that I'm running. >> >> Ideally I'd like to specify within each test whether the result can be >> cached or not. I looked at the documentation for testing >> <https://godoc.org/testing>, but the word "cache" is not present,

Re: [go-nuts] why is this not ascending?

2019-04-08 Thread Tom Mitchell
On Mon, Apr 8, 2019 at 10:15 AM T L wrote: > time.Sleep is not a synchronization method. > time.Sleep(dt) means pausing the execution of the current goroutine for at > least dt duration. > The actual paused duration may be longer than dt. > Not only is sleep not a synchronization method but I/O

Re: [go-nuts] Why does "go mod" ignore tags in this case?

2019-04-03 Thread Tom Payne
gt; go.mod still ends up containing the v0.0.0/timestamp/commit hash instead >> of v2.0.0. >> >> >> Why does go.mod contain v0.0.0/timestamp/commitHash instead of "v2.0.0"? >> >> >> Possibly relevant information: >> - I initially made a mistak

Re: [go-nuts] Accessing *[]uint64 from assembly - strange memory corruption under heavy load - any ideas?

2019-03-21 Thread Tom
ontban Tom a következőt írta: >> >> Still errors I'm afraid :/ >> >> On Thursday, 21 March 2019 21:54:59 UTC-7, Ian Lance Taylor wrote: >>> >>> On Thu, Mar 21, 2019 at 9:39 PM Tom wrote: >>> > >>> > I've been stuck on this for a fe

Re: [go-nuts] Accessing *[]uint64 from assembly - strange memory corruption under heavy load - any ideas?

2019-03-21 Thread Tom
Still errors I'm afraid :/ On Thursday, 21 March 2019 21:54:59 UTC-7, Ian Lance Taylor wrote: > > On Thu, Mar 21, 2019 at 9:39 PM Tom > > wrote: > > > > I've been stuck on this for a few days so thought I would ask the brains > trust. > > > > TL;DR

[go-nuts] Accessing *[]uint64 from assembly - strange memory corruption under heavy load - any ideas?

2019-03-21 Thread Tom
and should write tests / guards for? Thanks, Tom -- 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. For more

Re: [go-nuts] [CoC] screenshot images. Lazines or incompetence?

2019-03-12 Thread Tom Mitchell
On Mon, Mar 11, 2019 at 3:17 AM Wojciech S. Czarnecki wrote: > There is an emerging issue with screenshots of logs or code > being posted > ... > I also urge anyone who gives their time to look at the posted picture, > just because they can see, and who want to help a screenshot's OP >

Re: [go-nuts] What does a deadlock mean in golang?

2019-01-30 Thread Tom Mitchell
On Tue, Jan 29, 2019 at 12:55 AM 伊藤和也 wrote: > I know the general meaning of a deadlock, but I don't know the meaning of > a deadlock in golang. > Good question... A classic and now hard to find reference for a deadlock is "Operating System Principles (Prentice-Hall Series in Automatic

Re: [go-nuts] Re: Existing code for order-preserving concurrent work queue?

2019-01-27 Thread Tom Payne
don't want/need a distributed system. >>> >>> This feels like it should be common problem and there's probably either >>> a library or a standard Go pattern out there which can do it. My web search >>> skills didn't find such a library thou

Re: [go-nuts] Golang net/http server returning empty packets

2019-01-23 Thread Tom Cook
ver with “race detection” turned on - > this might be your best and easiest bet. > > On Jan 22, 2019, at 9:52 AM, Tom Cook > > wrote: > > I have a moderately complex HTTP server written using net/http > HandlerFuncs. Testing one request at a time all is we

[go-nuts] Golang net/http server returning empty packets

2019-01-22 Thread Tom Cook
quests per second high, not thousands, though the hardware is relatively limited (think RPi2 and you're not too far wrong). I'm using a custom mux, but it's a copy-and-paste of net/http.ServeMux with some extra logging added. Thanks for any help, Tom -- You received this message because you are

[go-nuts] Suggestions for layout/structure/coding-patterns for GUI applications in Go?

2019-01-11 Thread Tom
programs? What patterns work? Anything well-written & open-source I can learn from? GUI programs seems particularly heinous compared to server or system programs, which (at least to me) seem a lot easier to tease out parts & keep them simple-looking. Thanks & love, Tom -- You received

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

Re: [go-nuts] Go Documentation

2018-12-20 Thread Tom Limoncelli
are here: https://golang.org/doc/ 3. Miek Gieben wrote a book you can read online: https://www.miek.nl/go/ 4. A popular book by Donovan and Kernighan is called "The Go Programming Language": https://www.amazon.com/dp/0134190440/safocus-20 Tom -- Email: t...@whatexit.orgWork: tli

Re: [go-nuts] Go offline development recommendations

2018-12-12 Thread Tom Mitchell
On Wed, Dec 12, 2018 at 10:15 PM snmed wrote: > Thank you very much for your reply. It seems to be a possible way to do > it, what do you think about the athens way? In my point of view it would be > the easiest way as far i can preload the athens cache with all the required > packages, > And

Re: [go-nuts] Go offline development recommendations

2018-12-12 Thread Tom Mitchell
On Wed, Dec 12, 2018 at 12:00 PM snmed wrote: > Hi all > > Our customer demands an offline development environment with no internet > connection, is there any best practices to handle package download and > project setup for such an use case? And how would the new go modules fit in > in such an

Re: [go-nuts] Can package init() functions in different packages ever run concurrently?

2018-11-14 Thread Tom Payne
On Thursday, November 15, 2018 at 1:51:08 AM UTC+1, Ian Lance Taylor wrote: > > On Wed, Nov 14, 2018 at 4:43 PM, Tom Payne > > wrote: > > > > I couldn't find the answer to this from Googling. > > > > According to the documentation that I've found: >

[go-nuts] Can package init() functions in different packages ever run concurrently?

2018-11-14 Thread Tom Payne
init() functions could run in separate goroutines after C's init() function, without violating the above. However, this could cause problems if (for example) A and B's init() functions update a map in C without synchronization. Thanks for any answer, Tom -- You received this message because

Re: [go-nuts] How to get the user's umask without race condition?

2018-11-14 Thread Tom Payne
g only syscalls, >>> but you may be able to use /proc: >>> https://manpages.debian.org/stretch/manpages-dev/umask.2.en.html#NOTES >>> >>> >>> On Tue, Nov 6, 2018 at 4:35 PM Tom Payne > >>> wrote: >>> >>>> Hi, >>>> >>

[go-nuts] How to get the user's umask without race condition?

2018-11-06 Thread Tom Payne
this race condition? One heavyweight possibility is to read the umask during the main package's init, including a call to runtime.LockOSThread(). However, I'd like to be able to call my getUmask() function at any time. Many thanks for any pointers, Tom -- You received this message because you

Re: [go-nuts] Re: Large (binary or text) File transfers over rpc

2018-11-02 Thread Tom Mitchell
Moving files is a solved, non trivial problem Have you looked at tools like scp (ssh), rsync, kermit, ftp, sftp, tftp and network filesystems (nfs and samba)? Even git and http. Error recover, host name lookup, compression, restart, safe abort, transport encryption, authentication,

Re: [go-nuts] Go += Package Versioning

2018-02-20 Thread Tom Mitchell
On Tue, Feb 20, 2018 at 2:29 PM, Bakul Shah wrote: > On Tue, 20 Feb 2018 13:02:47 -0800 David Anderson > wrote: > > > > As a counterpoint to this: with vgo, I plan to make all my binary modules > > specify that they want the latest versions of everything,

Re: [go-nuts] Potential race condition in prototypical network server code

2017-08-24 Thread Tom Payne
Ah, cool. So graceful shutdown can be achieved by calling Close() on the net.Listener. Nice! Thank you :) Tom On Thursday, August 24, 2017 at 8:20:34 PM UTC+2, Jan Mercl wrote: > > net.Listener has a Close method that will make Accept return an error. > net.Listener.Accept is

Re: [go-nuts] Potential race condition in prototypical network server code

2017-08-24 Thread Tom Payne
a lot here. Is there anything above that is not correct? Cheers, Tom On Thursday, August 24, 2017 at 7:56:22 PM UTC+2, Jan Mercl wrote: > > The wg.Wait will be executed after l.Accept returns an error. It's purpose > is to wait for the completions of all handlers invoked in the go

Re: [go-nuts] Potential race condition in prototypical network server code

2017-08-24 Thread Tom Payne
Awesome, thanks Jan for the fast and clear response. In fact, the for {} is an infinite loop so wg.Wait() will never be reached and serve() will never terminate. Correct? I guess I over-read how much this prototypical code was representative of a real server loop. Sorry Dave! Tom On Thursday

[go-nuts] Potential race condition in prototypical network server code

2017-08-24 Thread Tom Payne
n his code. Cheers, Tom -- 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. For more options, visit https://groups.google.com/d/optout.

Re: [go-nuts] Reasoning behind behavior of range, when index is maintained

2017-08-02 Thread tom . payne
A side effect of this approach is that the index after the range loop will be zero if slice contains zero or one elements: https://play.golang.org/p/F7lLZ5wcuv This means that code using the index after the range will need to re-test whether the slice was empty to avoid a potential panic. On

[go-nuts] "go install": no warning/error when binaries conflict

2017-07-18 Thread tom . payne
ther is lost. For reference, the "cp" command in GNU Coreutils prints a warning when this occurs: $ cp pkg1/cmd/main.go pkg2/cmd/main.go . cp: will not overwrite just-created './main.go' with 'pkg2/cmd/main.go' Would the Go team be interested in a fix for this? Cheers, Tom

Re: [go-nuts] Re: understanding utf-8 for a newbie

2017-05-07 Thread Tom Limoncelli
-character-sets-no-excuses/ Plug: The Golang unicode decode/encode libraries are pretty confusing if you aren't already an expert in Unicode. I wrote https://github.com/TomOnTime/utfutil to make certain things easier. Tom On Sat, May 6, 2017 at 8:47 PM, Sam Whited <s...@samwhited.com> wrote:

[go-nuts] how to get process pid through port on which the process listened?

2017-04-29 Thread tom . jin . tong
hi, i want to find process pid through port, such as through 3306 got PID 2052 # netstat -nlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp0 0 0.0.0.0:33060.0.0.0:*

Re: [go-nuts] what's the max length of an identifier

2017-04-09 Thread Tom Limoncelli
Did the limit in C used to be 5 characters? That would explain "creat()". (That's a bit of trivia I've always wondered about) Tom On Wed, Apr 5, 2017 at 9:16 AM, Ian Lance Taylor <i...@golang.org> wrote: > On Wed, Apr 5, 2017 at 3:57 AM, Jan Mercl <0xj...@gmail.com>

Re: [go-nuts] Re: [ANN] Go geospatial libraries: geometries, GeoJSON, WKB, KML, PostGIS, GPX, polyline

2017-03-27 Thread Tom Payne
On 27 March 2017 at 19:15, Constantine Vassilev <thst...@gmail.com> wrote: > How to use go-geom to convert WKBHEX to KML? > > Are there a simple example? > > On Sunday, November 13, 2016 at 10:33:27 AM UTC-8, Tom Payne wrote: >> >> A quick announce of a few librarie

[go-nuts] Re: Conserving memory in TLS handshake and x509 certificate verification

2017-03-15 Thread Tom
Also quite curious about this. My assumption was that all resources should eventually be cleaned up when http.Client goes out of scope? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

[go-nuts] Dumbest golang mistakes

2017-03-05 Thread Tom
What are the dumbest, most obvious ways you have shot yourself in the foot? I just spend 3 hours debugging a network issue across three servers in dev, after copy-pasting some code from a crappy proof-of-concept into a complicated package with lots of modules. defer serverConn.Close() 1

[go-nuts] Re: [ANN] Rapid API tool: AWS Lambda + API Gateway + Go (Aegis)

2017-01-19 Thread Tom Maiaroto
Yes, you still need to use a wrapper of some sort. I chose Node.js, but am also thinking about using Python to see which is faster. That said, your Go Lambdas will typically (in every example of substance I've seen) will run faster than Node.js Lambdas. The wrapper is a bummer from an

[go-nuts] [ANN] Rapid API tool: AWS Lambda + API Gateway + Go (Aegis)

2017-01-19 Thread Tom Maiaroto
Hi all, I've advertised this tool and wrote a blog post about it even, but never really announced it here or in Slack. I thought a forum would be a better place for feedback than Twitter or something so I figured I'd post here. You can find the project here: https://github.com/tmaiaroto/aegis

[go-nuts] Gob encoding of maps is not consistent, should this be fixed?

2016-12-19 Thread Tom Payne
inputs do not result in the same outputs. Note that consistent encoding of the same value is *not* specified in the list of goals in https://blog.golang.org/gobs-of-data (in fact it is not mentioned at all). However, it could be considered a desirable feature :) Regards, Tom -- You received

[go-nuts] Deleting the /r/golang subreddit

2016-11-25 Thread Tom Cameron
This is the most ridiculous, short sighted, and I'll advised thing I've seen suggested on this list for a while. Are we also going to remove every article written about go in a newspaper, magazine, or blog because editors and journalists did something idiotic? Because if that's the case, we're

[go-nuts] Re: httputil.ReverseProxy adding 100+ ms of latency on localhost - any ideas?

2016-11-18 Thread Tom
ent ms. On Wednesday, 16 November 2016 16:01:50 UTC+11, Tom wrote: > > Hi guys, > > I've been working on a HTTP reverse proxy that has an auth/authorization > function. It all works well, however I have noticed significant additional > latency - and I cannot work out why. From wha

[go-nuts] Re: httputil.ReverseProxy adding 100+ ms of latency on localhost - any ideas?

2016-11-17 Thread Tom
Thanks guys for your suggestions. I am going to try: 1. GODEBUG=netdns=go+2 or GODEBUG=netdns=cgo+2 2. Running with just IP addresses to eliminate DNS 3. Creating a minimal program to reproduce latency and post here I agree that creating a ReverseProxy object every time is inefficent with

[go-nuts] httputil.ReverseProxy adding 100+ ms of latency on localhost - any ideas?

2016-11-15 Thread Tom
a very beefy machine! (8core 3.4Ghz Amd64) Anyone have any insights into httputil.ReverseProxy, or have any ideas where to begin? The method is here: https://github.com/twitchyliquid64/pushtart/blob/master/src/pushtart/webproxy/handler.go#L61 Cheers, Tom -- You received this message because

[go-nuts] Re: [ANN] Go geospatial libraries: geometries, GeoJSON, WKB, KML, PostGIS, GPX, polyline

2016-11-15 Thread Tom Payne
Done. I've also added a link to github.com/golang/geo, a library for geometry on the sphere. On Monday, November 14, 2016 at 11:25:19 PM UTC+1, Daniel Whitenack wrote: > > Thanks Tom! I think it would be great to add a few of these here: > > https://github.com/gopherds/resources

[go-nuts] [ANN] Go geospatial libraries: geometries, GeoJSON, WKB, KML, PostGIS, GPX, polyline

2016-11-13 Thread Tom Payne
A quick announce of a few libraries for geospatial applications that are now mature and battle-tested: https://github.com/twpayne/go-geom : efficient geometry library, using a high-performance cache-friendly data representation (more info

Re: [go-nuts] Re: Best practices for upgrading go with existing GOPATH?

2016-09-15 Thread Tom Elliott
Aha, now I understand. I managed to reproduce the problem and the failure was occurring while running go vet after the build target (which runs go build on all our packages). Switching to go install to build the packages cleared the problem right up. On Thu, 15 Sep 2016 at 20:19 Dave Cheney

[go-nuts] Re: Best practices for upgrading go with existing GOPATH?

2016-09-15 Thread Tom Elliott
out of date (at > best) or fail (at worse). > > Really, you want to use go install, just trust me on this, it'll make you > go experience much better all round. > > On Friday, 16 September 2016 04:03:54 UTC+10, Tom Elliott wrote: >> >> Thanks for the quick response :) >&g

[go-nuts] Re: Best practices for upgrading go with existing GOPATH?

2016-09-15 Thread Tom Elliott
Thanks for the quick response :) Great to hear that the go tool is intended to catch this. The problem was typically seen when running our default make target, which uses build for the build itself, but has some sanity checking and code generation steps first, with tools like glock, errcheck

[go-nuts] Best practices for upgrading go with existing GOPATH?

2016-09-14 Thread Tom Elliott
We've recently migrated from Go 1.6 to 1.7 within our engineering team, and have been experiencing some binary compatibility issues (as is to be expected) that have usually been corrected by emptying $GOPATH/pkg and rebuilding - this was recommended but as is the case with manual steps, people

[go-nuts] strings.SplitN(x, 1)

2016-07-04 Thread Tom Limoncelli
0: all substrings func SplitN(s, sep string, n int) []string { return genSplit(s, sep, 0, n) } Tom -- Email: t...@whatexit.orgWork: tlimonce...@stackoverflow.com Blog: http://EverythingSysadmin.com -- You received this message because you are subscribed to the Google Groups "golang-