Move the three regression test cases from _demo/ to _demo/go/: - issue1370_gotypes (go/types.Object test) - issue1370_goast (go/ast.Expr test) - issue1370_geometry (custom interface test) Updated import path in geometry.go to reflect new location. Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
26 lines
357 B
Go
26 lines
357 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"go/ast"
|
|
"go/token"
|
|
)
|
|
|
|
func main() {
|
|
ident := &ast.Ident{
|
|
NamePos: token.Pos(42),
|
|
Name: "foo",
|
|
}
|
|
|
|
var expr ast.Expr = ident
|
|
pos := expr.Pos()
|
|
|
|
fmt.Printf("Position: %d\n", pos)
|
|
if pos != 42 {
|
|
println("FAIL: Position mismatch")
|
|
return
|
|
}
|
|
|
|
println("SUCCESS: ast.Expr interface method calls work correctly")
|
|
}
|