fix warning
This commit is contained in:
@@ -55,7 +55,7 @@ func main() {
|
||||
if e == nil {
|
||||
enc := json.NewEncoder(os.Stdout)
|
||||
enc.SetIndent("", " ")
|
||||
enc.Encode(doc)
|
||||
check(enc.Encode(doc))
|
||||
return
|
||||
}
|
||||
err = e
|
||||
@@ -63,3 +63,9 @@ func main() {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
func check(err error) {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,6 +189,7 @@ func (p *parser) newError(errMsg string) *ParseTypeError {
|
||||
return &ParseTypeError{QualType: p.s.Source(), ErrMsg: errMsg}
|
||||
}
|
||||
|
||||
// TODO(xsw): check expect results
|
||||
func (p *parser) expect(tokExp token.Token) error {
|
||||
p.next()
|
||||
if p.tok != tokExp {
|
||||
@@ -330,6 +331,7 @@ func (p *parser) parseFunc(pkg *types.Package, t types.Type, inFlags int) (ret t
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_ = inFlags
|
||||
return ctypes.NewFunc(types.NewTuple(args...), results, variadic), nil
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ func NewPointer(typ types.Type) types.Type {
|
||||
}
|
||||
case *types.Signature:
|
||||
if gogen.IsCSignature(t) {
|
||||
return types.NewSignature(nil, t.Params(), t.Results(), t.Variadic())
|
||||
return types.NewSignatureType(nil, nil, nil, t.Params(), t.Results(), t.Variadic())
|
||||
}
|
||||
case *types.Named:
|
||||
if typ == ValistTag {
|
||||
|
||||
Reference in New Issue
Block a user