Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(447)

Unified Diff: src/cmd/goinstall/make.go

Issue 5307066: code review 5307066: non-pkg: gofix -r error (Closed)
Patch Set: diff -r 586479483dd6 https://go.googlecode.com/hg/ Created 13 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/cmd/goinstall/main.go ('k') | src/cmd/gotest/gotest.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cmd/goinstall/make.go
===================================================================
--- a/src/cmd/goinstall/make.go
+++ b/src/cmd/goinstall/make.go
@@ -8,8 +8,8 @@
import (
"bytes"
+ "errors"
"go/build"
- "os"
"path" // use for import paths
"strings"
"template"
@@ -18,7 +18,7 @@
// domake builds the package in dir.
// domake generates a standard Makefile and passes it
// to make on standard input.
-func domake(dir, pkg string, tree *build.Tree, isCmd bool) (err os.Error) {
+func domake(dir, pkg string, tree *build.Tree, isCmd bool) (err error) {
makefile, err := makeMakefile(dir, pkg, tree, isCmd)
if err != nil {
return err
@@ -36,9 +36,9 @@
// makeMakefile computes the standard Makefile for the directory dir
// installing as package pkg. It includes all *.go files in the directory
// except those in package main and those ending in _test.go.
-func makeMakefile(dir, pkg string, tree *build.Tree, isCmd bool) ([]byte, os.Error) {
+func makeMakefile(dir, pkg string, tree *build.Tree, isCmd bool) ([]byte, error) {
if !safeName(pkg) {
- return nil, os.NewError("unsafe name: " + pkg)
+ return nil, errors.New("unsafe name: " + pkg)
}
targ := pkg
targDir := tree.PkgDir()
@@ -56,7 +56,7 @@
isCgo := make(map[string]bool, len(cgoFiles))
for _, file := range cgoFiles {
if !safeName(file) {
- return nil, os.NewError("bad name: " + file)
+ return nil, errors.New("bad name: " + file)
}
isCgo[file] = true
}
@@ -64,7 +64,7 @@
goFiles := make([]string, 0, len(dirInfo.GoFiles))
for _, file := range dirInfo.GoFiles {
if !safeName(file) {
- return nil, os.NewError("unsafe name: " + file)
+ return nil, errors.New("unsafe name: " + file)
}
if !isCgo[file] {
goFiles = append(goFiles, file)
@@ -75,7 +75,7 @@
cgoOFiles := make([]string, 0, len(dirInfo.CFiles))
for _, file := range dirInfo.CFiles {
if !safeName(file) {
- return nil, os.NewError("unsafe name: " + file)
+ return nil, errors.New("unsafe name: " + file)
}
// When cgo is in use, C files are compiled with gcc,
// otherwise they're compiled with gc.
@@ -88,7 +88,7 @@
for _, file := range dirInfo.SFiles {
if !safeName(file) {
- return nil, os.NewError("unsafe name: " + file)
+ return nil, errors.New("unsafe name: " + file)
}
oFiles = append(oFiles, file[:len(file)-2]+".$O")
}
« no previous file with comments | « src/cmd/goinstall/main.go ('k') | src/cmd/gotest/gotest.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b