[go-nuts] Re: Recommended way to distribute pre-compiled C-dependencies for modules using CGO ?

2023-10-14 Thread Tamás Gulácsi
Neither I see a convenient way. BUT if you add a .go file into the directories where your precompiled libraries live, then "go get" will download them too (and only those dirs that have .go files in it). So your next mission is to prepare the right #cgo CFLAGS LDFLAGS incantations to use those

Re: [go-nuts] Dynamic template data from yaml

2023-10-14 Thread 'Dan Kortschak' via golang-nuts
On Sat, 2023-10-14 at 13:15 -0700, Tong Sun wrote: > Hmm... somehow I had the impression that only the exported fields can > be used in template as variables. > > Is that a wrong impression or things have changed? You are indexing into a map so so the notion of fields is not relevant. -- You

Re: [go-nuts] Dynamic template data from yaml

2023-10-14 Thread Tong Sun
On Saturday, October 14, 2023 at 3:47:54 PM UTC-4 Dan Kortschak wrote: On Sat, 2023-10-14 at 09:33 -0700, Tong Sun wrote: > Please take a look at > https://go.dev/play/p/dTDR50dtHB0 > > I want to > > - define my template data dynamically from yaml > - and export the yaml data if they

Re: [go-nuts] Dynamic template data from yaml

2023-10-14 Thread 'Dan Kortschak' via golang-nuts
On Sat, 2023-10-14 at 09:33 -0700, Tong Sun wrote: > Please take a look at  > https://go.dev/play/p/dTDR50dtHB0 > > I want to > > - define my template data dynamically from yaml > - and export the yaml data if they are unexported > > I.e., for the following code: > > t :=

[go-nuts] Dynamic template data from yaml

2023-10-14 Thread Tong Sun
Please take a look at https://go.dev/play/p/dTDR50dtHB0 I want to - define my template data dynamically from yaml - and export the yaml data if they are unexported I.e., for the following code: t := template.New("") t, err = t.Parse("It's {{.A}} {{.B.C}}!\n") if err != nil {

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

2023-10-14 Thread 'Mark' via golang-nuts
Yes, that's a much better solution. On Friday, October 13, 2023 at 8:40:45 PM UTC+1 Ian Lance Taylor wrote: > On Thu, Oct 12, 2023 at 11:42 PM 'Mark' via golang-nuts > wrote: > > > > Yes, I can see now. > > > > Perhaps consider changing: > > > > Programs that need more control over error

[go-nuts] Re: Recommended way to distribute pre-compiled C-dependencies for modules using CGO ?

2023-10-14 Thread Jan
Thanks Tamás, I may not be understanding correctly, but after taking a look at github.com/godror/godror, and the odpi subdirectory, I see it is including all the `.c` files on the fly . A couple of reasons immediately come to mind,