Skip to content

Commit

Permalink
Fix putenv (check key prefix properly)
Browse files Browse the repository at this point in the history
  • Loading branch information
axw committed Jul 7, 2012
1 parent 6ed339b commit f8ef66b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gocov/instrument.go
Expand Up @@ -159,8 +159,8 @@ func (v *funcVisitor) Visit(n ast.Node) ast.Visitor {
sv.VisitStmt(n.Body)
// TODO function coverage (insert "function.Enter", "function.Leave").

// TODO come up with naming scheme for function literals.
// case *ast.FuncLit:
// TODO come up with naming scheme for function literals.
// case *ast.FuncLit:
}
return v
}
Expand Down
2 changes: 1 addition & 1 deletion gocov/main.go
Expand Up @@ -59,7 +59,7 @@ type instrumenter struct {

func putenv(env []string, key, value string) []string {
for i, s := range env {
if strings.HasPrefix(s, "GOPATH=") {
if strings.HasPrefix(s, key+"=") {
env[i] = key + "=" + value
return env
}
Expand Down

0 comments on commit f8ef66b

Please sign in to comment.