Skip to content

Instantly share code, notes, and snippets.

@matyunin
Forked from msoap/script.go
Created June 27, 2018 08:18
Show Gist options
  • Select an option

  • Save matyunin/00f9ad8c6e0783719d25d2e5d44fa47f to your computer and use it in GitHub Desktop.

Select an option

Save matyunin/00f9ad8c6e0783719d25d2e5d44fa47f to your computer and use it in GitHub Desktop.

Revisions

  1. @msoap msoap revised this gist Mar 13, 2015. 1 changed file with 0 additions and 0 deletions.
    Empty file modified script.go
    100644 → 100755
    Empty file.
  2. @msoap msoap revised this gist Mar 13, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion script.go
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    //usr/bin/env go run $0 $@; exit
    //usr/bin/env go run $0 "$@"; exit
    package main

    import (
  3. @msoap msoap created this gist Mar 13, 2015.
    14 changes: 14 additions & 0 deletions script.go
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    //usr/bin/env go run $0 $@; exit
    package main

    import (
    "fmt"
    "os"
    )

    func main() {
    fmt.Println("Hello world!")
    cwd, _ := os.Getwd()
    fmt.Println("cwd:", cwd)
    fmt.Println("args:", os.Args[1:])
    }