Closed hlalibe closed 6 years ago
does it work if you replace it with:
book_up_data = append(book_up_data, plotter.Value{stringup}...)
I then get for that same line:
repl.go:11:41: not a type: plotter.Value <*ast.SelectorExpr>
Just realised, you missed the s I think at the end of plotter.Values.
So if I use book_up_data = append(book_up_data, plotter.Values{stringup}...)
then i get the same error as my first post:
types.NewSignature: variadic parameter must be of unnamed slice type
I think this is a gomacro bug so I'll bring @cosmos72 into the discussion here.
Using a type around a slice with variadic signatures is not allowed by types
. See types.NewSignature.
The following doesn't work:
type T []float64
var t T
append(t, 1.0)
where as this does
type T []float64
- var t T
+ var t []float64
append(t, 1.0)
Thanks for the extremely short code showing the problem, it made fixing it much easier :)
thanks @cosmos72 , it's working fine on my side now.
Struggling with the following code (which i simplified), Error is on line:
book_up_data = append(book_up_data, stringup)
If i comment it out, works ok. Error message is: types.NewSignature: variadic parameter must be of unnamed slice type
I've researched the topic of variadic parameters and unnamed slice type and tried to change the definition of book_up_data, but no results. The overall code is meant to prepare data to produce a chart. df is created by reading the content of an excel file, works nicely. No error messages when running program from terminal.