Bind attempts to generate bindings for everything a package exports, generating an error for what it cannot handle. For multiple bound packages, unexporting what should not be bound is sometimes awkward or outright impossible. Lacking the equivalent of Cgo's //export directory, this CL change the behaviour of bind to simply ignore everything it can't generate bindings for, even if otherwise exported. For every declaration it ignores, a comment is generated instead, to help any confusion as to why a particular export was not included. Change-Id: I2c7a5bee0f19a58009293b4e5ac2c95687e62e80 Reviewed-on: https://go-review.googlesource.com/20651 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
46 lines
717 B
Go
46 lines
717 B
Go
// Copyright 2016 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// package ignore tests that exported, but otherwise
|
|
// unsupported functions, variables, fields and methods
|
|
// are ignored by the generators
|
|
package ignore
|
|
|
|
var Var interface{}
|
|
|
|
type (
|
|
NamedString string
|
|
)
|
|
|
|
const NamedConst NamedString = "foo"
|
|
|
|
var V interface{}
|
|
|
|
func Argument(_ interface{}) {
|
|
}
|
|
|
|
func Result() interface{} {
|
|
return nil
|
|
}
|
|
|
|
type S struct {
|
|
F interface{}
|
|
}
|
|
|
|
type (
|
|
F func()
|
|
)
|
|
|
|
func (_ *S) Argument(_ interface{}) {
|
|
}
|
|
|
|
func (_ *S) Result() interface{} {
|
|
return nil
|
|
}
|
|
|
|
type I interface {
|
|
Argument(_ interface{})
|
|
Result() interface{}
|
|
}
|