Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: experimental/webtry/webtry.go

Issue 651343002: webtry: Check the result of os.Chdir(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/webtry/webtry.go
diff --git a/experimental/webtry/webtry.go b/experimental/webtry/webtry.go
index e644d138a71a26c3409e825d8706538e9fc8ffcc..9f7b47ebbfd6c31f5cf2edbd2bcae9a1379c2575 100644
--- a/experimental/webtry/webtry.go
+++ b/experimental/webtry/webtry.go
@@ -139,12 +139,13 @@ func init() {
rand.Seed(time.Now().UnixNano())
// Change the current working directory to the directory of the executable.
- var err error
cwd, err := filepath.Abs(filepath.Dir(os.Args[0]))
if err != nil {
log.Fatal(err)
}
- os.Chdir(cwd)
+ if err := os.Chdir(cwd); err != nil {
+ log.Fatal(err)
+ }
codeTemplate = template.Must(template.ParseFiles(filepath.Join(cwd, "templates/template.cpp")))
gypTemplate = template.Must(template.ParseFiles(filepath.Join(cwd, "templates/template.gyp")))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698