Generally, you can simply read the documents at http://golang.org/, but the real codermust find your own credit in practice.
Therefore, you have downloaded the goscripton https://github.com/andrebq/goscriptand modified it.
The correct parameter is passed without the disgusting comment implementation, saving the prompt that the file is modified every time in the editor.
The key implementation is a function called isource () to replace the original comment () of goscript ():
Func isource (DST, Src string) {<br/> file1, err: = OS. Open (SRC, OS. o_rdonly, 0) <br/> If Err! = Nil {<br/> error (FMT. sprintf ("can't open % s", Src) <br/>}< br/> defer file1.close () <br/> OS. remove (DST) <br/> file2, err: = OS. open (DST, OS. o_wronly | OS. o_creat, 0644) <br/> If Err! = Nil {<br/> error (FMT. sprintf ("can't open % s", flag. ARGs () [1]) <br/>}< br/> defer file2.close () <br/> buffile1: = bufio. newreader (file1) <br/> buffile2: = bufio. newwriter (file2) <br/> defer buffile2.flush () <br/> head, _: = buffile1.readstring ('/N') <br/> If Len (head)> = 2 & head [0: 2]! = "#! "{<Br/> // error (" First line: "+ head) <br/> buffile2.writestring (Head +"/N ") <br/>}< br/> Io. copy (buffile2, buffile1) <br/>}< br/>
Further, I found that none of the tag generation tools on the golang homepage can be compiled on the latest go version. Instead, I can use the powerful ctags RegEx syntax again:
#! /Bin/sh <br/> ctags -- exclude = * _ test. go -- langdef = go -- langmap = go :. go -- RegEx-Go = "/^ func // ([^)] + //)/S + (/W +) // 1/I "-- RegEx-Go ="/^ func/S + (/W +) // 1/I "-Re $ *
Go and Emacs are labels in Zone 42.
.
Welcome to join us.