This is a creation in Article, where the information may have evolved or changed.
Generally everyone is to look at http://golang.org/article even, but the real coder to practice coding to find confidence.
So we downloaded the goscript on the https://github.com/andrebq/goscript and corrected it to make it
Implement the correct parameter pass, and do not use that disgusting comment implementation, save every time the editor prompts the file to be modified.
The key implementation is a function called ISource (), which replaces Goscript's original comment ():
Func isource (DST, src string) {file1, err: = OS. Open (SRC, os. O_rdonly, 0) if err! = Nil {error (FMT. Sprintf ("Can ' t open%s", SRC))} defer file1. Close () OS. Remove (DST) file2, err: = OS. Open (DST, os. o_wronly | Os. O_creat, 0644) if err! = Nil {error (FMT. Sprintf ("Can ' t open%s", flag.) Args () [1])} defer file2. Close () BufFile1: = Bufio. Newreader (file1) BufFile2: = Bufio. Newwriter (file2) defer Buffile2.flush () head, _: = Buffile1.readstring ('/n ') If Len (head) >= 2 && head [0:2]! = "#!" {//error ("First line:" + head) buffile2.writestring (head + "/n")} io. Copy (BufFile2, BufFile1)}
Further, I found that none of the tag generation tools on the Golang home page can be compiled on the latest version of Go, but will again use the powerful ctags regex syntax:
#!/bin/shctags--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 just one of the 42-zone labels.
Welcome to communicate together.