Re: [go-nuts] passing a string slice to a variadic function expecting []interface{} or []any

2022-06-22 Thread Peter Galbavy
Thanks for setting my mind at ease. On Wednesday, 22 June 2022 at 16:05:17 UTC+1 axel.wa...@googlemail.com wrote: > No, there is no way to do it. You have to make a copy of the slice as you > did. > > On Wed, Jun 22, 2022 at 4:58 PM Peter Galbavy > wrote: > >> This is probably an FAQ but... >

Re: [go-nuts] passing a string slice to a variadic function expecting []interface{} or []any

2022-06-22 Thread 'Axel Wagner' via golang-nuts
No, there is no way to do it. You have to make a copy of the slice as you did. On Wed, Jun 22, 2022 at 4:58 PM Peter Galbavy wrote: > This is probably an FAQ but... > > I've tried to understand this before but gave up; I am trying to (quick > and dirty) import from a CSV or Excel file to a DB an

[go-nuts] passing a string slice to a variadic function expecting []interface{} or []any

2022-06-22 Thread Peter Galbavy
This is probably an FAQ but... I've tried to understand this before but gave up; I am trying to (quick and dirty) import from a CSV or Excel file to a DB and I would like to take the slice from csv.Read() and just pass it through to stmt.Exec() but because the first is a []string and the second

[go-nuts] Passing a string

2017-11-05 Thread Chun Zhang
Hi, All, I am trying to read a configuration file using Viper, the config file is a very simple json file with one line { "device" : "eth1" } I use the following line to read it device := viper.GetString("device") then passing this var further into a C library with swig generated api as ar