Re: [go-nuts] gofmt: expected declaration, found ')'

2023-04-16 Thread Andreas Götz
Forgive me. I have overlooked the fact, that this is a generated file that gets regenerated on the CI. Only in this case it must not since the generator does not cover a specific case and needs manual touch-up, hence must not be modified afterwrds. Sorry for the noise and wish you a nice

Re: [go-nuts] gofmt: expected declaration, found ')'

2023-04-16 Thread Jan Mercl
On Sun, Apr 16, 2023 at 12:51 PM Andreas Götz wrote: > Isn't gofmt ist part of the go command? Go ist the latest version: It is but it's a separate binary/executable file. Go version is one thing, the version of the binary file that is actually executed when '$ gofmt' is invoked is another

Re: [go-nuts] gofmt: expected declaration, found ')'

2023-04-16 Thread Andreas Götz
Isn't gofmt ist part of the go command? Go ist the latest version: Setup go version spec ^1.20 Found in cache @

Re: [go-nuts] gofmt: expected declaration, found ')'

2023-04-16 Thread 'Axel Wagner' via golang-nuts
I can't tell what version of gofmt is used? It does not seem to be manually installed, so I assume it is the one that comes with the image. Is it possible that's too old? I don't know why that would matter here, though, the code doesn't seem to be using any new language features. On Sun, Apr 16,

Re: [go-nuts] gofmt: expected declaration, found ')'

2023-04-16 Thread Andreas Götz
The entire file is https://raw.githubusercontent.com/evcc-io/evcc/a5f7bb0100c4427a2f611f82b742f56a449681de/charger/keba-modbus_decorators.go, part of https://github.com/evcc-io/evcc/pull/7485. Seems entirely find to me and works locally which makes it so confusing. Also formats fine:

Re: [go-nuts] gofmt: expected declaration, found ')'

2023-04-16 Thread Jan Mercl
On Sun, Apr 16, 2023 at 12:17 PM Andreas Götz wrote: > > Good morning. Please excuse me for asking here- I'm stuck with something that > looks like a gofmt bug though that seems very unlikely. > > In CI > (https://github.com/evcc-io/evcc/actions/runs/4712710735/jobs/8357929411?pr=7485) > I'm

[go-nuts] gofmt: expected declaration, found ')'

2023-04-16 Thread Andreas Götz
Good morning. Please excuse me for asking here- I'm stuck with something that looks like a gofmt bug though that seems very unlikely. In CI (https://github.com/evcc-io/evcc/actions/runs/4712710735/jobs/8357929411?pr=7485) I'm using a "porcelain" step to make sure only go-fmt'ed sources are

Re: [go-nuts] Re: Pointer constraint to generics

2023-04-16 Thread Jan
I think I see your point now, thanks for explaining. You are right, I should avoid having this sense of "type security". The `Pointer[]` library is only doing syntatic sugar around the fundamentally unsafe casting of an `unsafe.Pointer`. Having said that, unfortunately limiting it to a list of

[go-nuts] Re: cgo Compiling C files housed in different directory than Go files

2023-04-16 Thread Palash Bauri
I have made it work, by putting a go file in every child directory. https://github.com/bauripalash/cpank -- 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

Re: [go-nuts] Re: Pointer constraint to generics

2023-04-16 Thread 'Axel Wagner' via golang-nuts
The thing is, if it works with an arbitrary pointer type, it also works with `*[1<<30]byte`, giving unsafe memory access to essentially the entire memory space. Without any additional safeguards. You say it would "feel cleaner without the additional lines of unsafe.Pointer floating around", but