Re: [go-nuts] Re: Why is go vet slow

2024-10-01 Thread Rob Pike
Try this go list ./... | sed 's/.*/echo &; time go vet & /' | sh -rob -- 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+

Re: [go-nuts] Re: new range over int docs?

2024-02-07 Thread Rob Pike
Ha ha, someone forgot to change the year. It should read Jan 30, 2024. That's confusing. -rob On Wed, Feb 7, 2024 at 8:47 PM peterGo wrote: > Jason, > > The Go 1.22 source code says: > > "Subtitle": "Language version go1.22 (Jan 30, 2023)", > >

Re: [go-nuts] Any interest in nat.mulRange simplification/optimization?

2024-01-13 Thread Rob Pike
a language and libraries designed for numerical computation against a much less specialized and optimized world. Or perhaps from Julia using a different and dramatically more efficient algorithm. It does seem like a big gap, but I am no expert in this area. Maybe worth investigating further but not by me

Re: [go-nuts] Any interest in nat.mulRange simplification/optimization?

2024-01-13 Thread Rob Pike
Oh, I did say my implementation was straightforward. It's free of any clever multiplication algorithms or mathematical delights. It could easily be giving up 10x or more for that reason alone. And I haven't even profiled it yet. -rob On Sat, Jan 13, 2024 at 7:04 PM Bakul Shah wro

Re: [go-nuts] Any interest in nat.mulRange simplification/optimization?

2024-01-12 Thread Rob Pike
I may even try parallelization. -rob On Tue, Jan 9, 2024 at 4:54 PM Bakul Shah wrote: > For that you may wish to explore Peter Luschny's "prime swing" factorial > algorithm and variations! > https://oeis.org/A000142/a000142.pdf > > And implementations in vari

Re: [go-nuts] Any interest in nat.mulRange simplification/optimization?

2024-01-08 Thread Rob Pike
Here's an example where it's the bottleneck: ivy factorial !1e7 1.20242340052e+65657059 )cpu 1m10s (1m10s user, 167.330ms sys) -rob On Tue, Jan 9, 2024 at 2:21 PM Bakul Shah wrote: > Perhaps you were thinking of this? > > At iteration number k, the value xk contain

Re: [go-nuts] Any interest in nat.mulRange simplification/optimization?

2024-01-06 Thread Rob Pike
It seems reasonable but first I'd like to understand why the recursive method is used. I can't deduce why, but the CL that adds it, by gri, does Karatsuba multiplication, which implies something deep is going on. I'll add him to the conversation. -rob On Sun, Jan 7, 2024

Re: [go-nuts] circular package dependency between golang.org/x/mod and golang.org/x/tools

2023-12-19 Thread Rob Pike
If it's only in the test, the circularity only arises when testing both packages in a single build. That doesn't happen so is not a problem at all, and in fact the stdlib is full of such circularities involving common packages like fmt. -rob On Wed, Dec 20, 2023 at 7:49 AM Jan

Re: [go-nuts] bufio.Scanner - possible bug or doc err?

2023-10-12 Thread Rob Pike
I just did a simple test with a 2M line file and it worked fine, so I suspect it's a bug in your code. But if not, please provide a complete working executable example, with data, to help identify the problem. -rob On Thu, Oct 12, 2023 at 7:39 PM 'Mark' via golang-nut

Re: [go-nuts] Re: From which programming language did the idea for Golang's interface mechanism design originate?

2023-08-24 Thread Rob Pike
It was dreamed up independently at the whiteboard on the first day of design discussions. We did not know Emerald at the time; the similarity was discovered later. This is not to claim the idea is original, just that we discovered it independently. -rob On Fri, Aug 25, 2023 at 1:57 PM Andrew

Re: [go-nuts] binary.ByteOrder

2023-08-10 Thread Rob Pike
First read https://commandcenter.blogspot.com/2012/04/byte-order-fallacy.html then see https://go.dev/play/p/4ESm6nOwgtY -rob On Thu, Aug 10, 2023 at 8:46 PM Stephen Illingworth < stephen.illingwo...@gmail.com> wrote: > Hello, > > I want to detect the implementation of b

Re: [go-nuts] go package dating back to 2009

2023-07-25 Thread Rob Pike
hat's what you are doing. As Ian said, there was no public Go code in early 2009, and the private, internal code that became the public release was all written by a handful of Google engineers, your name (or Satoshi's) not among them. -rob On Wed, Jul 26, 2023 at 3:07 PM Jan Mercl &l

Re: [go-nuts] Re: Amateur's questions about "Go lang spec"

2023-06-11 Thread Rob Pike
Although the sentence is OK as it stands, the section should be tweaked a bit. One of the examples there (myString(0x65e5)) is valid Go but vet rejects it, as part of the move towards disallowing this conversion, which was there mostly for bootstrapping the libraries. -rob On Mon, Jun 12, 2023

Re: [go-nuts] How to detect a reflect.Value of nil ?

2023-06-01 Thread Rob Pike
I find this situation unsatisfactory. See https://github.com/golang/go/issues/51649 for my suggested fix. -rob On Fri, Jun 2, 2023 at 4:52 AM Ian Lance Taylor wrote: > On Thu, Jun 1, 2023 at 11:48 AM christoph...@gmail.com > wrote: > > > > I have a method that receives

Re: [go-nuts] Map of Types is impossible, is there any alternative solution?

2023-04-11 Thread Rob Pike
hould work. -rob On Wed, Apr 12, 2023 at 7:55 AM burak serdar wrote: > You can do: > > var messageProcessors = map[uint8]func([]byte) Message { > 0: processorForType0, > 1: processorForType1, > ... > } > > Then: > > output:=messageProcessors[id](payloa

Re: [go-nuts] Interesting "select" examples

2023-04-03 Thread Rob Pike
Here's an excerpt from a piece of concurrent code I like, an unpublished interactive game of life. The select near the bottom has only two cases but it is perhaps instructive. I leave its analysis to the reader. -rob var kbdC chan of rune = ... // events from keyboard var t

Re: [go-nuts] Re: Why can't a regexp.Regexp be const

2023-02-14 Thread Rob Pike
arentheses needed, as the alternation operator groups as you would expect. `[Mm][Pp][34]|[Ff][Ll][Aa][Cc]$` However, I suspect at least some of the elements must be parenthesized for the job at hand. -rob On Wed, Feb 15, 2023 at 2:51 AM Howard C. Shaw III wrote: > var ExtRegex = > regexp.M

Re: [go-nuts] Can I use the Golang logo on my site about Golang?

2023-01-18 Thread Rob Pike
golang.ru is a good name for such a site, but please keep in mind that the language itself is called just Go, as the logo itself should make clear. -rob On Thu, Jan 19, 2023 at 4:05 AM Ian Lance Taylor wrote: > On Wed, Jan 18, 2023 at 8:30 AM Василий Рузин wrote: > > > > Can I

Re: [go-nuts] Re: clarifying Go FAQ: Is Go an object-oriented language?

2022-11-23 Thread Rob Pike
Let me ask, because I'm genuinely curious: Why does it matter? The labels we apply to things do not affect their function. Perhaps it affects how we think about them. Is that it? -rob -- You received this message because you are subscribed to the Google Groups "golang-nuts&

Re: [go-nuts] Re: Unicode variable name error

2022-11-06 Thread Rob Pike
go/issues/20706 if you want to read more. -rob On Sun, Nov 6, 2022 at 9:52 PM Konstantin Khomoutov wrote: > On Sun, Nov 06, 2022 at 01:45:53PM +0530, Nikhilesh Susarla wrote: > > >> Per the Go spec[1], an identifier consists of a Unicode letter followed > by > >>

Re: [go-nuts] What's the maximum array length?

2022-10-27 Thread Rob Pike
Ah, and here's why. cmd/internal/obj/objfile as a 32-bit data size. if int64(uint32(dataOff)) != dataOff { log.Fatalf("data too large") } On Fri, Oct 28, 2022 at 3:15 PM Rob Pike wrote: > For those watching at home, the error message is > > compile: data too large

Re: [go-nuts] What's the maximum array length?

2022-10-27 Thread Rob Pike
For those watching at home, the error message is compile: data too large -rob On Fri, Oct 28, 2022 at 12:43 PM eric...@arm.com wrote: > The spec says that " The length is part of the array's type; it must > evaluate to a non-negative constant <https://go.dev

Re: [go-nuts] what is the origin of Go's reference time system?

2022-10-26 Thread Rob Pike
Not without breaking compatibility. -rob On Thu, Oct 27, 2022 at 5:15 PM Alex Besogonov wrote: > Can we perhaps get a bit more unambiguous reference date for it? > > On Wednesday, October 26, 2022 at 1:06:36 PM UTC-7 Rob 'Commander' Pike > wrote: > >> I belie

Re: [go-nuts] what is the origin of Go's reference time system?

2022-10-26 Thread Rob Pike
I believe it's unique. I thought of it one day while walking home. It is inspired by the way Cobol picture clauses represent number formats. (That said, I've never programmed in Cobol.) -rob On Thu, Oct 27, 2022 at 4:51 AM Ayan George wrote: > > I'm really impressed by t

Re: [go-nuts] Re: behavior of %f

2022-10-10 Thread Rob Pike
admittedly rather tricky—properties of imprecise arithmetic. -rob On Tue, Oct 11, 2022 at 9:01 AM Dante Castagnoli wrote: > Thanks! > > It's not lost, though. It shows up with the %g form. > > Knowing about %g, my issue is not extant, but others might hit it. I'm > r

Re: [go-nuts] int64(math.Inf(+1)) != math.MaxInt64

2022-10-03 Thread Rob Pike
Looks like a bug to me, so I filed https://github.com/golang/go/issues/56023 Thanks for reporting it. -rob On Tue, Oct 4, 2022 at 1:18 PM Jonathan Pearson wrote: > I expected int64(math.Inf(+1)) == math.MaxInt64, but it does not. > > In fact, these three values are equal: > int64

Re: [go-nuts] Struggling w/ use of a waitgroup

2022-10-02 Thread rob
Looks like you're right. I changed the order of the defer statement and now I'm not getting that error. Interesting that I never saw any file errors. Thanks --rob solomon On 10/2/22 14:46, Matthew Zimmerman wrote: First reason I notice, if there's an error opening your file

Re: [go-nuts] Struggling w/ use of a waitgroup

2022-10-02 Thread rob
When I do that, I get this error: panic: sync: negative WaitGroup number On 10/2/22 14:39, Jan Mercl wrote: On Sun, Oct 2, 2022 at 7:36 PM Robert Solomon wrote: https://go.dev/play/p/gIVVLsiTqod I believe wg.Add on line 125 is too late. I think it needs to be moved before the go statement

Re: [go-nuts] tip: data race when running test with coverage

2022-10-02 Thread Rob Pike
This is a race in new code, then, so please file an issue at https://go.dev/issue/new -rob On Sun, Oct 2, 2022 at 7:40 PM Shulhan wrote: > > On Sun, 2 Oct 2022 19:22:21 +1100 > Rob Pike wrote: > > > Apologies, the cover tool calls it -mode but the go command calls it > >

Re: [go-nuts] tip: data race when running test with coverage

2022-10-02 Thread Rob Pike
Also, it is documented: % go help testflag | grep mode -covermode set,count,atomic Set the mode for coverage analysis for the package[s] When 'go test' runs in package list mode, 'go test' caches successful % On Sun, Oct 2, 2022 at 7:22 PM Rob Pike wrote: > Ap

Re: [go-nuts] tip: data race when running test with coverage

2022-10-02 Thread Rob Pike
Apologies, the cover tool calls it -mode but the go command calls it -covermode. go test -covermode=atomic -rob On Sun, Oct 2, 2022 at 3:48 PM Shulhan wrote: > On Sun, 2 Oct 2022 10:41:17 +1100 > Rob Pike wrote: > > > When running coverage in a concurrent program, use t

Re: [go-nuts] tip: data race when running test with coverage

2022-10-01 Thread Rob Pike
When running coverage in a concurrent program, use the -mode=atomic flag to avoid data races in the counters. This unavoidably has a significant performance hit, but it should resolve this race. -rob On Sun, Oct 2, 2022 at 5:10 AM Shulhan wrote: > Hi gophers, > > The latest Go tip al

Re: [go-nuts] Go routine context

2022-09-30 Thread Rob Pike
er to keep goroutines anonymous and state-free, and not to bind any particular calculation or data set to one thread of control *as part of the programming model*. If you want to do that, sure, go for it, but it's far too restrictive to demand it *a priori* and force it on others*.* -rob

Re: [go-nuts] Unicode AzeriCase == TurkishCase?

2022-09-25 Thread Rob Pike
I believe so, but unicode.org is the place to research that question. Whatever Go does is defined by Unicode 13.0.0 at the moment. -rob On Mon, Sep 26, 2022 at 11:54 AM Holloway Kean Ho wrote: > > Hi all, > > Just to confirm, is the unicode special case "AzeriCase&

Re: [go-nuts] Re: private go documentation server similar to https://pkg.go.dev

2022-09-11 Thread Rob Pike
Yes, godoc. I need more sleep. -rob On Sun, Sep 11, 2022 at 6:39 PM Jan Mercl <0xj...@gmail.com> wrote: > > On Sun, Sep 11, 2022 at 4:20 AM Rob Pike wrote: > > > It would be nice if gofmt still had its -http option. You could run an > > old version. > > AFAICT,

Re: [go-nuts] Re: private go documentation server similar to https://pkg.go.dev

2022-09-10 Thread Rob Pike
It would be nice if gofmt still had its -http option. You could run an old version. -rob On Sun, Sep 11, 2022 at 8:01 AM peterGo wrote: > > https://go.googlesource.com/pkgsite/ > > On Saturday, September 10, 2022 at 5:28:35 PM UTC-4 brainman wrote: >> >> Hello Everyon

Re: [go-nuts] Add comparisons to all types

2022-05-02 Thread Rob Pike
semantics for slice equality. Checking if they are equivalent raises difficult issues around recursion, slices that point to themselves, and other problems that prevent a clean, efficient solution. Believe me, if equality for these types was efficient _and_ useful, it would already be done. -rob On

Re: [go-nuts] Golang and virustotal

2022-04-29 Thread Rob Pike
https://go.dev/doc/faq#virus On Fri, Apr 29, 2022 at 8:22 PM Paolo C. wrote: > > Hello, > I noticed that if you download golang portable zip for aMD64 and upload the > go.exe or gofnt.exe to virustotal one av complains. > If you compile a simple helloword main and upload, 4 or 5 minor av complain

Re: [go-nuts] Re: "\x7f"

2022-03-30 Thread Rob Pike
It's odd, and the oddness comes from the strconv package. But it's not incorrect. It happens because \x7f is kinda sort not ASCII, at least as far as strconv thinks. It's trivial to "fix", though, if a fix is necessary. https://github.com/golang/go/issues/52062 -rob

[go-nuts] Re: When will the official encoding/json package support parsing json5?

2022-03-17 Thread Rob Muhlestein
It is my sincere hope that Go will never support anything as poorly designed as JSON5, using reflection is already slow enough. Comments were never intended for JSON and never should be added, ever. But since most discerning development shops are moving to Protobuf for everything that matters,

Re: [go-nuts] Re: New edition of the Go Programming Language comming soon ?

2022-03-17 Thread Rob Muhlestein
one on my live streams and potentially teaching from it directly for the Go programming portion of the upcoming 2022 Beginner Boost. Thanks again, On Wednesday, March 16, 2022 at 4:57:36 AM UTC-4 rog wrote: > On Tue, 15 Mar 2022 at 04:58, Rob Muhlestein wrote: > >> The essential iss

Re: [go-nuts] Re: Parsing a time as a prefix of a larger string

2022-03-16 Thread Rob Pike
hen: 2006-01-02 15:04:05 - INFO this is a log message -rob On Thu, Mar 17, 2022 at 11:44 AM ben...@gmail.com wrote: > > >> How does the user control the format of the timestamp? How do you get the >> time.Parse layout? > > > The project is a lightweight servic

Re: [go-nuts] Pointer to a pointer

2022-03-15 Thread Rob Pike
Actually the one I was referring to is in the main repo at test/peano.go, but it's the same idea. -rob On Tue, Mar 15, 2022 at 10:10 PM Jochen Voss wrote: > > Thanks for the pointer to peano.go, this is fun! > > It took me a while to locate the file. In case others are intere

Re: [go-nuts] Re: New edition of the Go Programming Language comming soon ?

2022-03-14 Thread Rob Muhlestein
th a simpler future.) With Go 1.18 we have a real opportunity to correct this. For the record, I'm slowly putting together enough material to crowd-source a beginner Go 1.18 book and have probably a few dozen people interested in helping, but like so many others, I have other stuff I'm

[go-nuts] Re: New edition of the Go Programming Language comming soon ?

2022-03-14 Thread Rob Muhlestein
As an educator and mentor I've had very negative feedback about that book from dozens, from 12 to 50 years old. I preordered 25 when it came out and regret ever having anyone start Go with it. One brilliant kid (who went on to teach himself Assembly and C) nearly threw it at me. To date, I have

[go-nuts] Re: I just published : Iterator lib for Go: Library providing Map(), Filter(), Reduce() for Go

2022-03-14 Thread Rob Muhlestein
Here's one with 1.18 generics: https://github.com/rwxrob/fn (for fun). On Wednesday, August 25, 2021 at 10:17:59 AM UTC-4 Serge Hulne wrote: > https://github.com/serge-hulne/go_iter > > go get github.com/serge-hulne/go_iter > > Currently working on the doc and examples. > -- You received this m

Re: [go-nuts] Pointer to a pointer

2022-03-10 Thread Rob Pike
an early (and very interesting) test. -rob On Fri, Mar 11, 2022 at 1:01 AM Manlio Perillo wrote: > > On Thursday, March 10, 2022 at 2:48:27 PM UTC+1 axel.wa...@googlemail.com > wrote: >> >> On Thu, Mar 10, 2022 at 2:38 PM Manlio Perillo wrote: >>> >>> On

Re: [go-nuts] Pointer to a pointer

2022-03-10 Thread Rob Pike
On Thu, Mar 10, 2022 at 5:08 PM shan...@gmail.com wrote: > > Is this really how you want to be known? Sure, why not? It's a more interesting program than one might think. For a richer example of the foundational idea here, see the peano.go program in the test directory in the

Re: [go-nuts] Pointer to a pointer

2022-03-09 Thread Rob Pike
******

Re: [go-nuts] Re: Why, oh why, do people do this? Things that annoy me in Go code.

2022-03-07 Thread Rob Pike
It could have been interface UnreceivedMasterOrdersInterfaceThatCanBeUsedToCallGetUnreceivedByProductsWarehouseAndCompany Seriously, though, your example isn't even on the same planet as some of the examples I've seen. (Neither is my parody.) Sympathies. -rob On Tue, Mar 8, 2022

Re: [go-nuts] How Does This Work?

2022-03-06 Thread Rob Pike
hat the reflect library allows you to _read_ unexported values, but not _write_ them. If Printf couldn't print unexported values (nobody else could either), then debugging would be a lot harder. -rob On Mon, Mar 7, 2022 at 4:39 PM Martin Schnabel wrote: > > one important detail i have not f

Re: [go-nuts] Looping and tail-end code

2022-01-12 Thread Rob Pike
What's wrong with for ;; time.Sleep(delay) { ... } ? This technique is as old as the hills. Or at least as old as C for loops. -rob On Wed, Jan 12, 2022 at 9:02 PM Tobias Klausmann wrote: > > Hi! > > Often with tools that poll something, you get code of this form:

Re: [go-nuts] Threats found on Win 10 21H1 64 bit computer

2021-12-17 Thread rob
I filed this bug report against Microsoft Windows Defender Antivirus. I hope you're right, Ian --rob solomon On 12/16/21 8:34 PM, Ian Lance Taylor wrote: On Thu, Dec 16, 2021 at 3:18 PM Robert Solomon wrote: Since this is Windows Defender, the bug report would have to go to Microsoft.

[go-nuts] Threats found on Win 10 21H1 64 bit computer

2021-12-15 Thread rob
ink my Win 10 setup is so unusual.  This has been happening for months; I saw this behavior also when compiling using earlier versions of Go 1.17, and also Go 1.16 I don't remember it happening before Go 1.16 --rob solomon -- You received this message because you are subscribed to the Goog

Re: [go-nuts] Re: Do you have a minimal runnable go code that contain all key words in go?

2021-12-07 Thread Rob Pike
Oh, it needs to be runnable. Never mind. -rob On Wed, Dec 8, 2021 at 11:19 AM Rob Pike wrote: > > It's easy to fold a few things together: https://go.dev/play/p/6lpZmGH9iJb > > Nice work though. > > On Wed, Dec 8, 2021 at 5:15 AM ben...@gmail.com wrote: > > > &g

Re: [go-nuts] Re: Do you have a minimal runnable go code that contain all key words in go?

2021-12-07 Thread Rob Pike
It's easy to fold a few things together: https://go.dev/play/p/6lpZmGH9iJb Nice work though. On Wed, Dec 8, 2021 at 5:15 AM ben...@gmail.com wrote: > > Heh, nice! I made it three bytes smaller by defining "const t = true" (true > was used in 2 places). https://go.dev/play/p/-3SvzKYjGSr ... I ca

Re: [go-nuts] Q: Why does Gob deserialize a ptr to an empty string back as null?

2021-12-01 Thread Rob Pike
same. In fact they are not encoded at all. -rob On Thu, Dec 2, 2021 at 7:22 AM 'Robert Whitcher' via golang-nuts wrote: > > https://go.dev/play/p/bZtT0XdqmRg.go?download=true > > Seems like it is impossible to differentiate between not set and set to empty > string

Re: [go-nuts] Re: gob: decoding into local type []float64, received remote type []float

2021-11-29 Thread Rob Pike
that has not already been transmitted. In effect, it can't tell the difference between calling it twice to deliver to one encoder and calling it twice to deliver to two decoders. Don't reuse the encoder. -rob On Mon, Nov 29, 2021 at 7:51 PM cpu...@gmail.com wrote: > > Turns out t

Re: [go-nuts] cgo error I don't understand

2021-11-05 Thread rob
That was it.  It's working now. Thank you very much. --rob solomon On 11/4/21 11:00 PM, Roland Müller wrote: Hello, the entry in the path for mingwin is wrong: it should be either start with C:\ or another drive letter or in case it's an absolute path with double backslash.

Re: [go-nuts] Re: Why Doesn't "len()" Work With Structs?

2021-10-25 Thread Rob Pike
See also https://github.com/golang/go/issues/29982. It gets more interesting towards the bottom, but the proposal is on hold. Be nice to release it again though. I do favor it. -rob On Tue, Oct 26, 2021 at 8:48 AM Ian Lance Taylor wrote: > > On Sun, Oct 24, 2021 at 4:45 PM jlfo...@berkel

Re: [go-nuts] slices grow at 25% after 1024 but why 1024?

2021-09-04 Thread Rob Pike
What would you pick? You need to pick something. It was just arbitrary, I'm sure. 1024 is a nice number, and it's larger than the length of many slices. Sometimes a number is just a number. -rob On Sun, Sep 5, 2021 at 3:14 AM Miraddo wrote: > Hey Guys, > > We know slic

Re: [go-nuts] Re: Is there a preview Golang version I can download to try out generics ?

2021-08-22 Thread Rob Pike
oth that you must bootstrap from amd64 binaries, and that that tends to stick. It took a few tries to get arm64 established. So whatever you do, use the file command after the fact to verify that you have arm64 binaries. The translation is so good that you might well be running amd64 and not know it. -rob

Re: [go-nuts] Golang language specification Document: Composite Literals example is not understandable

2021-06-22 Thread Rob Pike
That creates a slice 101 integers long, which probably isn't what you meant, which might help explain why you never came across it before. Smile. -rob On Wed, Jun 23, 2021 at 7:07 AM jake...@gmail.com wrote: > I'm surprised that I have never come across this as a way to create a

Re: [go-nuts] Knowing from documentation whether an interface is holding a pointer or a struct?

2021-06-06 Thread Rob Pike
this article I know I wrote: https://blog.golang.org/laws-of-reflection. I recently translated a substantial C library into Go, and watching all the pointers disappear, at least syntactically (there were still slices), was marvelous. -rob On Sun, Jun 6, 2021 at 6:21 PM Joshua wrote: > Thanks all

Re: [go-nuts] Re: Why the limit on regex repeat is 1000?

2021-06-06 Thread Rob Pike
ere to the clear, theoretically strong properties of regular languages, are free to use other techniques, at the cost of potentially catastrophic execution times. -rob On Sun, Jun 6, 2021 at 6:18 PM Alberto Donizetti wrote: > Probably not a bug, since it's documented: > > https

Re: [go-nuts] Why the limit on regex repeat is 1000?

2021-06-06 Thread Rob Pike
-and.html). You are using a steamroller to press a shirt. -rob On Sun, Jun 6, 2021 at 4:12 PM M Hasbini wrote: > Playground: https://play.golang.org/p/opVpDD5Ts8S > > Here's an example regex that fails to compile: `[a-zA-Z0-9]{1001,}` > > Here's where the 1000 is specif

Re: [go-nuts] Is it possible to produce coverage profiles for *_test.go files?

2021-05-19 Thread Rob Pike
*testing.T) { t.Helper(); ... } The disadvantage is that you'd need to pass the build tag when you run the test, but that is easy to do in a script. -rob On Wed, May 19, 2021 at 8:23 PM Piers Powlesland wrote: > I'm working on a project with some quite complex test code and I&#

Re: [go-nuts] package is not in GOROOT

2021-04-09 Thread rob
Thanks. If only the docs would make that clear. My experience with reading them is: clear only if previously known. Much frustration about modules could have been avoided by more clearly written documentation So it goes -- rob drrob...@fastmail.com On Fri, Apr 9, 2021, at 11

Re: [go-nuts] package is not in GOROOT

2021-04-07 Thread rob
eference. --rob solomon On 4/7/21 10:24 AM, wagner riffel wrote: Hi Rob, it's good that you got it working, but I feel you're struggling with modules inferred from your past emails due a confusion between a module namespace and the file system, your package import paths and go commands

Re: [go-nuts] package is not in GOROOT

2021-04-07 Thread rob
It does help me. Thanks -- rob drrob...@fastmail.com On Wed, Apr 7, 2021, at 10:24 AM, wagner riffel wrote: > On Tue, 6 Apr 2021 19:39:00 -0400 > rob wrote: > > > > This example is on Win10 using go 1.16.3 > > > > Now I've created a directory t

[go-nuts] package is not in GOROOT

2021-04-06 Thread rob
code/hpcalc2", etc. Now I can use go run gcode/rpng/rpng.go And I set GOBIN=c:\Users\rob\gcode     go install gcode/rpng/rpng.go and it installs to GOBIN. At least it's working for me mostly the way it was before.  I just had to abandon my ~/go directory Thanks for answerin

[go-nuts] package is not in GOROOT

2021-04-05 Thread rob
I'm still struggling w/ modules to get my code to compile.  This example is on Win10 using go 1.16.3 ~/go/src/rpng/rpng.go ~/go/src/tokenize/tokenize.go ~/go/src/hpcalc2/hpcalc2.go I'm logged into ~/go/src and I type this, like I used to do in the "old" days:     go install rpng Now I get

Re: [go-nuts] Unexpected error from os.DirEntry on Win10

2021-03-13 Thread rob
I need file timestamp and size, so I need a full FileInfo. -- rob drrob...@fastmail.com On Sat, Mar 13, 2021, at 6:11 PM, Axel Wagner wrote: > > > On Sat, Mar 13, 2021 at 11:52 PM rob wrote: >> Sorry, I did not intend to open a new thread. >> I don't know h

Re: [go-nuts] Unexpected error from os.DirEntry on Win10

2021-03-13 Thread rob
Sorry, I did not intend to open a new thread. I don't know how to answer you about the actual contents of the directory of interest.  It's my c:\users\rob\Documents directory. There are a lot of files there.  I'm writing my own version of the dir command, one that will

[go-nuts] Unexpected error from os.DirEntry on Win10

2021-03-11 Thread rob
s the glob pattern on widows 10. I'll check, but I'm able to call os.ReadDir on an individual file on Ubuntu 20.04. I'll confirm when I get home that I'm getting a FileInfo structure returned from this routine -- rob drrob...@fastmail.com -- You received thi

[go-nuts] Unexpected error from os.DirEntry on Win10

2021-03-11 Thread rob
e expected that os.ReadDir can find the filename just as os.Lstat does. --rob solomon // rddirpblm to isolate the problem w/ going from filepath.Glob to os.ReadDir on Win10. package main import (     "fmt"     "os"     "path/filepath"     "runtime"

Re: [go-nuts] still struggling to understand modules

2021-02-26 Thread rob
ome/name/go/src to create a module there run go mod init When I try "go mod init" in my /home/rob/go/src, I get an error go: cannot determine module path for source directory /home/rob/go/src (outside GOPATH, module path must be specified) How do I specify my local code? The

Re: [go-nuts] still struggling to understand modules

2021-02-25 Thread rob
that simple instruction could be added to the documentation? It would help complete idiots (or dummies) like me. --rob solomon --- Now I have a curious problem.  Most of the code I've written is compiling.  I'm using go 1.15.8 under

Re: [go-nuts] still struggling to understand modules

2021-02-25 Thread rob
..     Now I'm back in ~/go/src     go install multack I get an error saying that "package multack is not in GOROOT (usr/local/go/src/multack)" If I do     go run multack/multack.go That works. What does this error message mean? Thanks again. --rob solomon On 2/24/21 10:23 P

Re: [go-nuts] still struggling to understand modules

2021-02-24 Thread rob
forgive my denseness --rob solomon -- 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

Re: [go-nuts] still struggling to understand modules

2021-02-24 Thread rob
That would immediately make obsolete books like "The Go Programming Language" by Alan Donovan and Brian Kerninghan, because none of their code would compile as is. However, it does provide opportunities for people to write more books --rob solomon On 2/23/21 9:32 PM, Amit Saha wrote:

[go-nuts] still struggling to understand modules

2021-02-23 Thread rob
-code.  And then I'm lost. If this is not the correct forum to post this very basic request for help, guidance as to where else I should GO would be helpful. --rob solomon -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] About the confusion caused by type conversion in golang

2021-01-27 Thread Rob Pike
This topic is well explained in the blog post at blog.golang.org/constants, if I do say so myself. -rob On Thu, Jan 28, 2021 at 4:45 PM Arunkumar Gudelli < arunkumar.gude...@gmail.com> wrote: > 256 considered as `constant`. (untyped) > So when we try to convert to byte (which has

Re: [go-nuts] Go Create

2021-01-12 Thread Rob Pike
required care) applies when patching a library. Modules work well but you do need to read and understand the documentation. The posts in blog.golang.org are good. You can start here: https://blog.golang.org/v2-go-modules -rob On Wed, Jan 13, 2021 at 6:53 AM Jim Ancona wrote: > I have a third

Re: [go-nuts] Ballooning Executable Sizes

2020-11-19 Thread Rob Pike
Filed https://github.com/golang/go/issues/42729 On Fri, Nov 20, 2020 at 6:34 AM stephen.t@gmail.com < stephen.t.illingwo...@gmail.com> wrote: > Hello, > > I have a reasonably sized project that produces executables that have > ballooned in size between two relatively simple commits. > > I've

Re: [go-nuts] Are float64 and float32 exact in Golang (like strictfp in Java)

2020-09-25 Thread Rob Pike
There is more than one Go compiler and the use of fused-multiply-add is not guaranteed. The Go spec permits FMA but does not require it. I suggest reading the "Floating-point operators" section of the specification for clarity here. -rob On Sat, Sep 26, 2020 at 9:23 AM Ian Lance Tay

Re: [go-nuts] Find n-th root of a big number

2020-09-22 Thread Rob Pike
exponent. I'll leave that cryptic comment alone to let you puzzle it out yourself. (Don't look it up; it's much more fun to figure out.) -rob On Tue, Sep 22, 2020 at 3:11 AM Hau Phan wrote: > i can't find get n-th root in document of go big package so i decided to > do

Re: [go-nuts] Re: Efficient bitmask twiddling

2020-09-01 Thread Rob Pike
It's not a bit array, it's a bool array. Can you make it a bit array and use bit != 0 for the boolean elsewhere? -rob On Wed, Sep 2, 2020 at 5:55 AM Oliver Smith < oliver.sm...@superevilmegacorp.com> wrote: > Do godbolt links get eaten? https://godbolt.org/z/vbeobs > >

[go-nuts] [generics] Syntax feedback

2020-06-27 Thread Rob Reid
{ fmt.Print(v) } } Cheers, Rob -- 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

Re: [go-nuts] Re: Speed up png.Decode

2020-06-26 Thread Rob Pike
ingful help for problems like this, the more information you can provide, the better. -rob On Fri, Jun 26, 2020 at 10:59 PM Lee Armstrong wrote: > Thanks, I am already maxing out some servers but wondered if it could be > sped up. > > I will give the bimg package a go! > > On Friday

Re: [go-nuts] Why isn't there "number plus" postfix syntax for more than or equal?

2020-04-23 Thread Rob Pike
if r == 13 despiteallobjections { ... } -rob On Fri, Apr 24, 2020 at 8:04 AM 'Dan Kortschak' via golang-nuts < golang-nuts@googlegroups.com> wrote: > I look forward to the addition of the definition of "in a handwavy > sense" to the spec. > > On Thu, 20

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

2020-04-12 Thread Rob Pike
e variable failureTrigger and in the test write: func TestWhatIfNeverIsToday(t *testing.T) { failureTrigger = true defer func() { failureTrigger = false } call code test that zounds is invoked. } -rob On Sun, Apr 12, 2020 at 11:55 PM Kevin Malachowski wrote: > Is there a particul

Re: [go-nuts] correction in make documentation

2020-04-11 Thread Rob Pike
It's not just the size, though, it's also what kind of thing gets made. I think it's better as is. -rob On Sun, Apr 12, 2020 at 6:02 AM Feroz Jilla wrote: > Hello community :) > > I was going through the golang documentation on the `make` function here - > https://

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: &

Re: [go-nuts] help w/ therecipe/qt

2020-03-01 Thread rob
Yes, thanks Justin.  It looks that's just what I need. --rob On 3/1/20 3:16 PM, Justin Israel wrote: On Mon, Mar 2, 2020 at 6:48 AM rob <mailto:drrob...@fastmail.com>> wrote: The exact problem is one of the first in chapter 4 MainWindow::MainWindow() {    

Re: [go-nuts] help w/ therecipe/qt

2020-03-01 Thread rob
;    helpMenu = menuBar()->addMenu("Help");    aboutAction = new QAction("About", this);    aboutAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_H));    helpMenu->addAction(aboutAction);    // Setup Signals and Slots    connect(quitAction, &QAction::triggered, this, &

Re: [go-nuts] help w/ therecipe/qt

2020-02-29 Thread rob
"Getting Started w/ Qt 5," by Benjamin Baka.  Published by Packtpub On 2/29/20 2:55 PM, Rob Muhlestein wrote: Hi there Rob, would you mind sharing that book so I can share it with people on my rwxrob.live stream. I like the idea of doing what you are doing. I might be able to hel

[go-nuts] help w/ therecipe/qt

2020-02-29 Thread rob
Hi.  I'm trying to learn therecipe/qt by working my way thru a book using C++ examples and translating them into Go.  I'm stuck at QKeySequence stuff. My computer runs ubuntu 18.04, and I installed Go 1.13.8 on it, along w/ all the Qt development stuff from qt.io, and therecipe/qt. Where are

Re: [go-nuts] Re: Why isn't there strings.reverse("str") function?

2020-02-27 Thread Rob Pike
Once bytten, twice shy. -rob On Fri, Feb 28, 2020 at 10:17 AM Jesper Louis Andersen < jesper.louis.ander...@gmail.com> wrote: > The key observation is that you only look at a byte once. > > On Thu, Feb 27, 2020, 22:49 Amnon Baron Cohen wrote: > >> You are right. >&

Re: [go-nuts] Re: Go mindshare is low & ~flat, per Google Trends

2020-01-27 Thread Rob Muhlestein
flat, yet obviously YAML has massive "mindshare." --- “Mr. Rob” Muhlestein /^((Found|Teach|Hack)er|(Men|Jani)tor|C\w+O)$/ r...@robs.io • skilstak.io ‐‐‐ Original Message ‐‐‐ On Sunday, January 26, 2020 5:51 PM, Liam wrote: > Google Trends is commonly used to discern pu

  1   2   3   >