Print itself: Difference between revisions

Added Go
(stdout print loop)
 
(Added Go)
Line 32:
{ „maxlines” }
</lang>
 
=={{header|Go}}==
<lang go>package main
 
import (
"fmt"
"io/ioutil"
"log"
"os"
"path"
)
 
func main() {
self := path.Base(os.Args[0]) + ".go"
bytes, err := ioutil.ReadFile(self)
if err != nil {
log.Fatal(err)
}
fmt.Print(string(bytes))
}</lang>
 
{{out}}
Just the invoking line as remainder is, of course, as above.
<pre>
$ go run self_print.go
</pre>
9,476

edits