From 157278e06ee6d14412be4d18d13cd4470f2aa089 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sat, 2 Jun 2018 08:45:30 +1000 Subject: [PATCH] stop tracking notes --- notes/go.notes | 78 -------------------------------------------------- 1 file changed, 78 deletions(-) delete mode 100644 notes/go.notes diff --git a/notes/go.notes b/notes/go.notes deleted file mode 100644 index 1e0c0b8d0..000000000 --- a/notes/go.notes +++ /dev/null @@ -1,78 +0,0 @@ -TODO: - -committing -blowing away files: - if it's untracked, delete it - if it's tracked, check it out - - - ------------------------------------------------------------ - GO ------------------------------------------------------------ - -Running and Building: - -$ go run hello-world.go -hello world - -$ go build hello-world.go -$ ls -hello-world hello-world.go - -$ ./hello-world -hello world - ------------------------------------------------------------ - DIRECTORY STRUCTURE ------------------------------------------------------------ - -https://golang.org/doc/code.html - -if you don't have your GOPATH exported, do so with -export GOPATH=$(go env GOPATH) - -you have a GOPATH which points to e.g. ~/go/ -this is where everything in go is stored. - -it has three directories, - - src - - pkg - - bin - -installed programs have their executables stored in bin -all your project and the src code of other people's projects are in src, with paths identifying them e.g. -src/github.com/jesseduffield/gitgot - -If you want to make an executable, give every file in your project directory `package main`, otherwise if you want to make a package, name everything `package mypackage`. This name should be the name of the project directory for your project. - -to install a program, inside the project folder -go install - -This adds the program to /bin - -to build a package, inside the project folder -go build - -this adds the package to /pkg so that it can be linked easily in the future. - -to build and run your program just do this: - -~/github.com/jesseduffield/gitgot: -▶ go install && gitgot - ------------------------------------------------------------ - BUILD SYSTEMS ------------------------------------------------------------ - -Currently for installs I'm using -/Users/jesseduffieldduffield/Library/Application Support/Sublime Text 3/Packages/User/custom_go_install.sublime-build - -note that the argument to go install should be the directory from the end of /src/ onwards. - ------------------------------------------------------------ - FMT ------------------------------------------------------------ - -casting anything to a string -fmt.Sprint(thing)