Ignore unused objects in code generated by Go 1.10 cgo
Closes
@@ -7,6 +7,8 @@ import (
)
var (
+ // used by cgo before Go 1.11
+ oldCgo = []byte("// Created by cgo - DO NOT EDIT")
prefix = []byte("// Code generated ")
suffix = []byte(" DO NOT EDIT.")
nl = []byte("\n")
@@ -25,6 +27,9 @@ func isGenerated(r io.Reader) bool {
if bytes.HasPrefix(s, prefix) && bytes.HasSuffix(s, suffix) {
return true
}
+ if bytes.Equal(s, oldCgo) {
+ return true
+ }
if err == io.EOF {
break
}
