I mean serious recently used the go language and added it to zone 42 ^ _

Source: Internet
Author: User

 

 

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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.