Re: [go-nuts] godoc and generic code

2022-11-03 Thread Hotei
Sebastien Binet wrote: > On Thu Nov 3, 2022 at 14:02 CET, Jan Mercl wrote: > > On Thu, Nov 3, 2022 at 12:49 PM Hotei wrote: > > > > > I added some generic code to a project and godoc doesn't seem to like > that and stops working when it sees the generics. It's a 4 yea

[go-nuts] godoc and generic code

2022-11-03 Thread Hotei
I added some generic code to a project and godoc doesn't seem to like that and stops working when it sees the generics. It's a 4 year old version of godoc so that's perhaps not a surprise. What is a surprise is that godoc isn't shipped with go any longer. Is there a version that handles

Re: [go-nuts] I'm missing godoc for local packages after converting to modules.

2021-03-31 Thread Hotei
e, unrelated modules, but > you could work around it by defining a dummy package & module with imports > to the modules you wish to include (use replace to point to the local > version) and running `godoc` from the dummy module > > On Sunday, March 28, 2021 at 4:01:37 PM

[go-nuts] Re: How to wait for HTTP server to start?

2021-03-28 Thread Hotei
jerome - not sure that the code you provided fully answers the OP's problem. I think you'd need to craft an http request and get a response to really KNOW that the server is indeed responding. If you do that as a replacement for where you have the "select {}" then I think you've got it.

Re: [go-nuts] I'm missing godoc for local packages after converting to modules.

2021-03-28 Thread Hotei
Clarification. As mentioned earlier, $GOPATH is supposed to go away in the (possibly near) future so one of my main goals is to get it working outside the $GOPATH tree. At present my solution has been to copy my source tree (about 4 GB) to a "non-module-aware" go ecosystem on a different

[go-nuts] I'm missing godoc for local packages after converting to modules.

2021-03-27 Thread Hotei
Could use a little help figuring out how to attack the following problem: I normally run godoc locally with $godoc -http=":6060"& and then browse it with chrome. Many years ago that method broke for a while as godoc was "reinvented" but then it came back pretty much the same as before. A

Re: [go-nuts] Re: build world question

2021-03-18 Thread Hotei
Jan, To clarify a bit, "world" used to be everything under $GOPATH/src. Since gophers can expect at some point to see $GOPATH go away the directory I now refer to as "world" is just a local/private version of my github.com/hotei repository with about 250 or so su

[go-nuts] Re: build world question

2021-03-18 Thread Hotei
own "go.mod"), or just separate packages within the same module > (go.mod only exists at the top level)? Normally the latter is what you > want. > > On Wednesday, 17 March 2021 at 17:57:55 UTC Hotei wrote: > >> Heeding the prodding of the go gurus on this lis

[go-nuts] build world question

2021-03-17 Thread Hotei
Heeding the prodding of the go gurus on this list I just converted a bunch of old code to modules and was wondering what the "module" equivalent to "go build ./..." is. I used to be able to use that command at the top of my code tree and it would attempt to build everything in the subdirs.

[go-nuts] Re: os.remove is slow

2017-12-04 Thread Hotei
Gabriel - Thank you for reminding me that perl is a write-only language. It's been a few years since I had to deal with it. How many files are we talking about and on what media? On Monday, December 4, 2017 at 12:50:54 PM UTC-5, Gabriel Forster wrote: > > What takes 18 seconds in a perl

Re: [go-nuts] Is there a way to check if all pending finalizers have been executed?

2016-10-15 Thread Hotei
re "meaningfullness" - I think he's saying that a finalizer for a function called in a goroutine might not run if main() quits first, intentionally or otherwise. You can of course check for this specific case by making sure all your goroutines are cleaned up before exiting main - but in some

[go-nuts] Re: Rational number to floating point

2016-09-19 Thread Hotei
I think you'll need something like x := float(355) / float(113) - where float is either float32 or float64 depending on your preferred trade-off for accuracy vs bytes required per number. On Monday, September 19, 2016 at 12:38:12 PM UTC-4, Mark Longtin wrote: > > Hey guys, > > I'm new to Go

[go-nuts] Re: Differences in archive/zip between 1.6.3 / 1.7

2016-08-18 Thread Hotei
Because zip compression programs can use different levels of compression there is certainly no expectation that zipping the same file with different compression levels will give the the same output. It MIGHT - but it's not to be expected or relied upon. The only thing that's "guaranteed" is

[go-nuts] Re: cmdline--improve Golang std.flag based on Go src v1.7

2016-08-18 Thread Hotei
I assume you're aware it's valid to have two initializers for the same variable.? I often use -v and -verbose to both modify flagVerbose. var flagVerbose bool func init() { boolVar(,"v" boolVar( "verbose" } Other than that I don't see what your package is actually enhancing over

Re: [go-nuts] Reject Unknown clients

2016-08-04 Thread Hotei
Sam, I'm guessing but a lot of (non-commercial) folks use an inexpensive "wireless router" with NAT as their "firewall". Besides, the application code is trivial. Probably less than a hundred lines. Potentially s a good teaching moment for using go and how it does http. On the other hand -

[go-nuts] Re: Reject Unknown clients

2016-08-04 Thread Hotei
Certainly possible. You can put the whitelisted IPS in a map and use that to filter the incoming requests. On Thursday, August 4, 2016 at 10:17:37 AM UTC-4, Naveen Shivegowda wrote: > > Is it possible to make http servers listen only on a few source ip's and > request from any other source

[go-nuts] Re: How to check that a Go package has not been modified?

2016-08-03 Thread Hotei
The fact that collisions are possible does not make them "easy to create" especially when you add the compileable requirement. If you're uneasy about md5 you could always use more bits - like SHA1 used by "git" or SHA256 (or larger) if you're really paranoid. On Wednesday, August 3, 2016 at

[go-nuts] Re: Will compiler do optimization here?

2016-08-03 Thread Hotei
If you create the source as a byte array by converting it ([]byte("abcde") then the compiler can NOT optimize it away. However - I don't think it will *use* the capacity information in the source since it's not relevant and it's going to copy the data bytes and length in any case. If you're

[go-nuts] Re: Will compiler do optimization here?

2016-08-03 Thread Hotei
Looking at the asm it appears that there is a conversion func called in the second version - right before the copy with memmove. Based on this I'd say what happens AFTER the conversion is the same in both version since the destination is the same and the content is the same. The only

[go-nuts] Re: Will compiler do optimization here?

2016-08-03 Thread Hotei
Have you tried examining the assembler output? go build -gcflags="-S" program.go if I recall correctly. On Wednesday, August 3, 2016 at 11:27:36 AM UTC-4, T L wrote: > > > I know a string value can be used as []byte if the first parameter if the > builtin copy/append function is a []byte

[go-nuts] Re: Data locality in large slices

2016-08-03 Thread Hotei
With times under one nanosecond I'm wondering what you're actually measuring. Aggressive optimization could make this an "empty" loop. Synthetic benchmarks like this can be tricky to interpret. On Wednesday, August 3, 2016 at 7:56:32 AM UTC-4, Ondrej wrote: > > I wanted to see if there was a

[go-nuts] Re: recommended push notification library for Go

2016-07-28 Thread Hotei
Depending on your needs (you didn't specify the target mobile devices) you can use go's SMTP facilities to send an email to a phone via an SMS gateway. This list might help though I'm not sure how current it is. http://mfitzp.io/list-of-email-to-sms-gateways/ On Thursday, July 28, 2016 at