[go-nuts] Re: templates not working for me

2024-02-07 Thread joseph.p...@gmail.com
Ok, Variable substitution doesn't seem to work in an included template file. Is that a known limitation? On Saturday, February 3, 2024 at 11:40:40 PM UTC-8 joseph.p...@gmail.com wrote: > I'm goofing around with GIN and trying some examples. I can't get > templating to work for me. > > File in

[go-nuts] Re: Go 1.22.0: Alpine: go test with coverage works but returns exit status 1

2024-02-07 Thread Martin
I need to add: In the post the reproducer test is of course to short, so the test show that it fails all the time. But that triggers the problem anyway. Better would be this: func TestHelloer(t *testing.T) { want := "Hello, world!" got := Helloer() if got != want { t.Errorf("Helloer()

Re: [go-nuts] Re: Changing PWD ruins test caching

2024-02-07 Thread Kevin Burke
Sorry for slow reply. We are using Alpine, which I don't think is either of those flavors. I discovered this by enabling GODEBUG=gocachehash=1, running the tests twice, and then checking the diff between the two test runs. On Tue, Nov 28, 2023 at 11:57 AM 'Bryan C. Mills' via golang-nuts < golang

[go-nuts] Go 1.22.0: Alpine: go test with coverage works but returns exit status 1

2024-02-07 Thread Martin
I am using the new `golang:1.22.0-alpine3.19` Alpine image to build and test a Golang 1.22.0 application. The test uses coverage like that `go test -v ./... -coverprofile=coverage.out -coverpkg=./internal/... -covermode count`. The test command seems to work fine, but the exit status is 1. The

[go-nuts] 1.22.0 ServeMux HandleFunc infinite loop

2024-02-07 Thread Péter Szarvas
Hello, I noticed if you set up a route like /something/{id}/{$}, it results in an infinite loop if I navigate to /someting/ (with the trailing slash). I got a redirect to Location: /something/, and so on. Finally the page breaks after multiple rounds. Example: mux := http.NewServeMux() mux.Han

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

2024-02-07 Thread Robert Griesemer
On Wed, Feb 7, 2024 at 9:58 AM Jason E. Aten wrote: > Thanks Robert. Succeess: I see the latest go1.22 spec now on > https://go.dev/ref/spec > > Minor nit: As Rob pointed out, the year in the sub-title is off by one. > (It says Jan 30, 2023, while almost surely the author of the update meant > J

[go-nuts] Re: Error on installing package

2024-02-07 Thread Jason Phillips
There's an application in the "internal/play" folder of that module. You can install it via: go install 154.pages.dev/google/internal/play@v1.4.0 As for how to use it, I have no idea, you'll have to reach out to the maintainer if there's no documentation. On Wednesday, February 7, 2024 at 9:1

Re: [go-nuts] "yield" is backwards

2024-02-07 Thread mspre...@gmail.com
I see. I was thinking of it from the point of view of the author of this yield/consume function. From that party's perspective, this function expresses the consumption of the value, not its production. But since the new go lang feature will make that not an explicit function, that is not the mo

Re: [go-nuts] "yield" is backwards

2024-02-07 Thread Marvin Renich
* mspre...@gmail.com [240207 10:43]: > The go language is getting better and better for functional programming, > and I am here for it. I have enjoyed using APL, Scheme, Python. I was > excited to see https://go.dev/wiki/RangefuncExperiment . However, I am > puzzled by the choice to name the fu

[go-nuts] Re: Bound check optimization with "computed" index

2024-02-07 Thread 'Keith Randall' via golang-nuts
I'm not sure, but I suspect that the prove pass does not propagate known ranges through divides. On Tuesday, February 6, 2024 at 7:39:56 AM UTC-8 Leonard Mittmann wrote: > I am trying to optimize the loop performance by reducing the number of > bound checks. Inside the loop I compute a slice in

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

2024-02-07 Thread Jason E. Aten
Thanks Robert. Succeess: I see the latest go1.22 spec now on https://go.dev/ref/spec Minor nit: As Rob pointed out, the year in the sub-title is off by one. (It says Jan 30, 2023, while almost surely the author of the update meant Jan 30, 2024). "The Go Programming Language Specification Languag

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

2024-02-07 Thread Robert Griesemer
Spec is up-to-date at tip, now: https://tip.golang.org/ref/spec https://golang.org/ref/spec should be updated soon, too. Apologies for the confusion. - gri On Wed, Feb 7, 2024 at 8:11 AM Jason E. Aten wrote: > Thanks Peter. I see the latest spec at tip.golang.org. > > p.s. Go Team: At least in

Re: [go-nuts] "yield" is backwards

2024-02-07 Thread 'Axel Wagner' via golang-nuts
I'm not sure what you mean. The `yield` function does exactly the same as Python's `yield` statement and in fact, that's part of why the name was chosen. Compare Python: def vals(a): for v in a: yield v for x in vals([1,2,3]): print(x) With Go: func vals[T any](s []T) iter.

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

2024-02-07 Thread Jason E. Aten
Thanks Peter. I see the latest spec at tip.golang.org. p.s. Go Team: At least in the UK, the page served from https://go.dev/ref/spec does not, at the moment, match that of https://tip.golang.org/ref/spec , so somebody may need to do an update (if not of origin server, maybe of CDN caches?)

[go-nuts] "yield" is backwards

2024-02-07 Thread mspre...@gmail.com
The go language is getting better and better for functional programming, and I am here for it. I have enjoyed using APL, Scheme, Python. I was excited to see https://go.dev/wiki/RangefuncExperiment . However, I am puzzled by the choice to name the function parameter that _receives_ a Seq's valu

[go-nuts] Re: Error on installing package

2024-02-07 Thread Smit K
How to use this 154.pages.dev/google@v1.4.0 On Tuesday, February 6, 2024 at 10:07:24 PM UTC+5:30 Jason Phillips wrote: > Perhaps you wanted "go get 154.pages.dev/goo...@v1.4.0 > "? > > On Tuesday, February 6, 2024 at 11:36:11 AM UTC-5 Jason Phillips wrote: > >

[go-nuts] Group Cache Behaviour

2024-02-07 Thread Vallabh Chugh
Hi folks, Fairly new to the k8s world. I am using group cache .I run a go routine to fetch all set of pods for a deployment and update my group cache pool if there is a change every 60 second. The problem i see is if that if there is a change in the pool (pods added) and if the incoming reques

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

2024-02-07 Thread peterGo
Jason, File an issue with the Go release team to clean up the mess. Peter On Wednesday, February 7, 2024 at 7:12:08 AM UTC-5 Brian Candler wrote: > But the main point is, the canonical version published at > https://go.dev/ref/spec is still from Aug 2, 2023 > > On Wednesday 7 February 2024 at

Re: [go-nuts] Re: Do we need to call multipart.Part.Close

2024-02-07 Thread Pedro Luis Guzmán Hernández
Thanks all, I'll continue to call it for now, since that's what most engineers on my team would expect in that situation, but I'll happily reconsider if some documentation gets added at some point. El miércoles, 7 de febrero de 2024 a las 0:44:13 UTC+1, Ian Lance Taylor escribió: > On Tue, Fe

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

2024-02-07 Thread 'Brian Candler' via golang-nuts
But the main point is, the canonical version published at https://go.dev/ref/spec is still from Aug 2, 2023 On Wednesday 7 February 2024 at 12:02:28 UTC Rob Pike wrote: > Ha ha, someone forgot to change the year. It should read Jan 30, 2024. > > That's confusing. > > -rob > > > On Wed, Feb 7, 20

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)", > > Blame > > #569 9289b9c gri@*.*** 2024-01

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

2024-02-07 Thread peterGo
Jason, The Go 1.22 source code says: "Subtitle": "Language version go1.22 (Jan 30, 2023)", Blame #569 9289b9c gri@*.*** 2024-01-31 16:40 [release-branch.go1.22] spec: clarify iteration variable type for range over integer Change-Id: I4f1d220d5922c40a36264df2d0a7bb7cd0756bac https://cs