1. Ross Light
  2. SCons Go Tools

Commits

Ross Light  committed 823b697

Fix scons-go-helper to compile on new releases
Fix mktemp call on Ubuntu

Thanks to Graham Miller for the patch!

  • Participants
  • Parent commits 03a98a6
  • Branches default

Comments (0)

Files changed (2)

File build-helper.sh

View file
 if [[ -e "$GC" && -e "$LD" ]]
 then
     # Build it!
-    TEMPDIR="`mktemp -d -t scons-go-helper`" || crash "**Couldn't create temporary directory"
+    TEMPDIR="`mktemp -d -t scons-go-helper.XXXX`" || crash "**Couldn't create temporary directory"
     $GC -o "${TEMPDIR}/helper.$ARCHPREFIX" helper.go || crash "**Compile failed"
     $LD -o "${TEMPDIR}/scons-go-helper" "${TEMPDIR}/helper.$ARCHPREFIX" || crash "**Linking failed"
 else

File helper.go

View file
 		if !name.IsExported() {
 			return false
 		}
-		n := name.Name()
+		n := name.Name
 		return hasPrefix(n, "Test") || hasPrefix(n, "Benchmark")
 	}
 	go func() {
 	go func() {
 		defer close(ch)
 		for _, fname := range flag.Args() {
-			fileNode, err := parser.ParseFile(fname, nil, nil, 0)
+			fileNode, err := parser.ParseFile(fname, nil, 0)
 			if err != nil {
 				fmt.Fprintf(os.Stderr, "Error parsing %s: %v\n", fname, err)
 				if fileNode == nil {
 		}
 	case "package":
 		for fileNode := range parseArgs() {
-			fmt.Println(fileNode.Name.Name())
+			fmt.Println(fileNode.Name.Name)
 		}
 	case "tests":
 		for fileNode := range parseArgs() {
 			for decl := range extractTests(fileNode) {
-				fmt.Printf("%s.%s\n", fileNode.Name.Name(), decl.Name.Name())
+				fmt.Printf("%s.%s\n", fileNode.Name.Name, decl.Name.Name)
 			}
 		}
 	default: