Hi,
Occasionally go vet complains about shadowing of the err variable.
Consider the following code.
package main
import (
"flag"
"io"
"os"
)
func main() {
inFilename := flag.String("in", "infile", "input file")
outFilename := flag.String("out", "outfile", "output file")
flag.Parse()
in, err :=
e been violating cgo rules by passing Go pointer to an integer to the C
code for storage.
C.nlopt_set_max_objective(n.gopt,
(C.nlopt_func)(unsafe.Pointer(C.callback_adaptor)), unsafe.Pointer(&nID))
Now I do it like this instead:
C.nlopt_set_max_objective(n.gopt,
(C.nlopt_func)(unsafe.Pointer(
Hi,
As far as I understand, os.Stdout & os.Stderr are not buffered.
log.Debug writes to stderr. I replaced log.Debug with println, the result
is the same.
Cheers,
Iakov
P.S. Struggling with creating a minimal example; the results is not very
stable. Will put it here if I will manage.
On Thursda
Hi,
I don't have a minimal example yet, but this looks very suspicious. It
seems that sometimes defer called before the function finishes, if cgo code
with callbacks is called in it.
Here's the code:
func (n *NLOPT) Run(iterations int) {
log.Debug("entering Run method")
...