The gobind command is about to get more powerful and able to generate complete and standalone bindings. Platform specific build tags based on GOOS or GOARCH are now meaningless to generate bindings from, so remove them from the test packages. The tags mattered to the reverse bound packages, since the go tool can't build them without the Go wrappers for the imported Java packages. Before this CL, the `android` tag was used to fool the go tool since the host GOOS is unlikely to be android. A fix is to check in the generated Go wrappers, but since the packages are for testing we don't want that. Instead, move the test packages to the testdata directory so the go tool ignores them. Change-Id: I57178e930a400f690ebd7a65758bed894eeb10b0 Reviewed-on: https://go-review.googlesource.com/99315 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
48 lines
1.1 KiB
Go
48 lines
1.1 KiB
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 objcpkg
|
|
|
|
import (
|
|
"ObjC/Foundation/NSDate"
|
|
"ObjC/Foundation/NSString"
|
|
"ObjC/QuartzCore/CAMediaTimingFunction"
|
|
)
|
|
|
|
func Func() {
|
|
NSDate.Date()
|
|
CAMediaTimingFunction.FunctionWithControlPoints(0, 0, 0, 0)
|
|
}
|
|
|
|
func Method() string {
|
|
d := NSDate.Date()
|
|
return d.Description()
|
|
}
|
|
|
|
func New() {
|
|
NSDate.New()
|
|
CAMediaTimingFunction.NewWithControlPoints(0, 0, 0, 0)
|
|
}
|
|
|
|
func Error() {
|
|
str, err := NSString.StringWithContentsOfFileEncodingError("<non-existent>", 0)
|
|
if err == nil {
|
|
panic("no error from stringWithContentsOfFile")
|
|
}
|
|
// Assert err is an error
|
|
err = err.(error)
|
|
if str != "" {
|
|
panic("non-empty string from stringWithContentsOfFile")
|
|
}
|
|
str, err = NSString.NewWithContentsOfFileEncodingError("<non-existent>", 0)
|
|
if err == nil {
|
|
panic("no error from stringWithContentsOfFile")
|
|
}
|
|
// Assert err is an error
|
|
err = err.(error)
|
|
if str != "" {
|
|
panic("non-empty string from initWithContentsOfFile")
|
|
}
|
|
}
|