Thanks Ian. Yeah. I am generating those files and committing them. I will try the option you suggested
On Tuesday, November 19, 2019 at 8:23:02 AM UTC-8, Ian Lance Taylor wrote: > > On Tue, Nov 19, 2019 at 7:17 AM Vishnu <vishn...@gmail.com <javascript:>> > wrote: > > > > Sorry. Yes, I was trying to modify the code to see if the error goes > away. > > > > type swig_gostring struct { p uintptr; n int } > > func swigCopyString(s string) string { > > p := *(*swig_gostring)(unsafe.Pointer(&s)) > > r := string((*[0x7fffffff]byte)(unsafe.Pointer(p.p))[:p.n]) // This > line gives the go vet error: possible misuse of unsafe.Pointer > > Swig_free(p.p) > > return r > > } > > > > > > How do I exclude the file from going through go vet. I tried putting the > below header in the file but didn't help > > > > // Code generated by swig. DO NOT EDIT. > > Normally people use SWIG with Go by adding a .swig file in their Go > directory and letting the go tool invoke SWIG directly. If you do > that, then as far as I know go vet will not look at the generated > code. Are you invoking SWIG yourself and committing the resulting > files? > > Ian > -- 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 golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/a73e5861-f9ad-46da-94e1-1800aaec79ac%40googlegroups.com.