Home
Gosh Documentation
Contents
1. go get github com mkouhei gosh OS X Install the follow packages with Homebrew e Go e Mercurial with Homebrew Set GOPATH install d path to gopath export GOPATH path to gopath If you install goimports in advance recommend export PATH GOPATH bin PATH go get code google com p go tools cmd goimports Install the Gosh go get github com mkouhei gosh 1 1 4 Basic usage Examples 4 Chapter 1 Gosh interactive shell for golang Gosh Documentation Release 0 2 3 SGOPATH bin gosh gt gt gt import fmt gt gt gt func main gt gt gt fmt Println hello gt gt gt hello gt gt gt or GOPATH bin gosh gt gt gt func main gt gt gt fmt Println hello gt gt gt hello gt gt gt Note Enabled to omit import statement for standard packages Enabled to import non standard packages Example of using non standard package gt gt gt import net http gt gt gt import example org somepkg gt gt gt func main gt gt gt r _ http Get http example org some gt gt gt defer r Body Close gt gt gt p _ somepkg Reader r Body gt gt gt fmt Println p gt gt gt print some payload 1 1 5 Usage when omitting main function declarations Example GOPATH bin gosh gt gt gt i 4 1 gt gt gt i
2. GNU GPL version 3 or later lt http gnu org licenses gpl html gt This is free software and you are welcome to redistribute it There is NO WARRANTY to the extent permitted by law gt gt gt 2 1 4 Debug mode SGOPATH bin gosh d Gosh Documentation Release 0 2 3 2 1 5 Sudo mode gt v0 3 0 Warning The gosh runs sudo mode Be careful your code don t run the dangerous code There is no warranty for this free software See also the GPLv3 LICENSE You can use sudo mode s option when Your code requires the privilege for example using ICMP echo request SGOPATH bin gosh s sudopassword 2 2 Terminate Gosh Enter Ctrl D gt gt gt gosh terminated 2 3 Execute main function Go syntax validly gt gt gt package main gt gt gt import fmt gt gt gt func main gt gt gt fmt Printin hello gt gt gt hello gt gt gt 2 3 1 Omit package import statement main func Gosh supports omitting as follows e package statement e import statement for standard libraries e func main signature So users give the same results with the following gt gt gt fmt Println hello hello gt gt gt 2 3 2 fmt Printx are executed only once gt gt gt 1 1 gt gt gt for i lt 3 1 gt gt gt fmt Println i gt gt gt i gt gt gt 8 Chapter
3. import example org somepkg gt gt gt resp _ http Get http example org some gt gt gt defer resp Body Close gt gt gt payload _ somepkg Reader resp Body gt gt gt fmt Printin payload print some payload Users are able to omit import net http package that is Go standard library If users import the same package Gosh ignores duplicate import adn treats as import of only once 2 6 Declaration of type Gosh supoorts declaration of type gt gt gt type foo struct gt gt gt msg string gt gt gt cnt int gt gt gt gt gt gt f foo hello 0 gt gt gt for f cnt lt 3 gt gt gt fmt Println f msg gt gt gt f cnt gt gt gt hello hello hello gt gt gt Gosh supports re declarations of type gt v0 3 0 2 7 Declaration of function Gosh supports declaration of function gt gt gt func test msg string bool gt gt gt if strings HasPrefix msg Hello gt gt gt return true gt gt gt gt gt gt return false gt gt gt gt gt gt fmt Println test helo false gt gt gt fmt Printlin test hello false gt gt gt fmt Println test Hello true 10 Chapter 2 User Manual Gosh Documentation Release 0 2 3 Gosh supports re declarations of function gt gt gt func bar gt gt gt fmt Printin hello gt gt gt gt gt g
4. 2 User Manual Gosh Documentation Release 0 2 3 This omit main func is equivalent to the main func not following omitted gt gt gt func main gt gt gt i 1 gt gt gt for i lt 3 gt gt gt fmt Println i gt gt gt i gt gt gt gt gt gt But fmt Print are executed only once gt gt gt fmt Println 1 1 gt gt gt fmt Println 2 This fmt Print x are removed main body after executing main function 2 4 Reset declaration of main func Execute follow command gt gt gt func main For example test function gt gt gt func test gt gt gt fmt Println hello gt gt gt Execute test twice gt gt gt test hello gt gt gt test hello hello This is equivalent to the main func not following omitted gt gt gt func main gt gt gt test gt gt gt test gt gt gt So print hello once after reset main gt gt gt test hello gt gt gt func main gt gt gt test hello 2 4 Reset declaration of main func Gosh Documentation Release 0 2 3 2 5 Import packages Gosh supports imports 3rd party libraryies Gosh enter the import package Gosh executes go get and installs the package into the GOPATH of Gosh process For example of using the some package gt gt gt
5. Gosh Documentation Release 0 2 3 Kouhei Maeda November 06 2015 Contents 1 Gosh interactive shell for golang 3 1 1 Documentation lt se ess e gotak ba Ea a a ea 3 2 User Manual 7 21 R n Goshir sui he He a aa oh ee hee Bede ws tt Ge Sook Ge Be BEE eb ae Sb aa Ae Bh SAH 6 7 2 2 MEME OSA rg ae bh ok Pee ek Ge E da oe ERAS 8 2 3 Execute main TUNCHOM 50 aieea eke Be be Be OK A ee he bel de Be ap BO A Gand Boe de 8 2A Reset declaration of main fume c s cr m A A ee ee RE A a 9 29 import PACkKAses 2 gti gett A eed oe ep Ghee Oe Bal ee eo Baw aes 10 2 6 Declaration of type s i pera oe Sats bes Lae we eee bbe bE eee kG 10 2 7 Weclarationof function s s soge paris 6464 624 446 4484 446i bb BASS Ra 10 3 Internals 13 4 History 15 4 1 0 30 not rel ase occiso a eee de ews 15 AD 023 QUISDIS sai ee Re eo E AR Ee a A 15 43 0 2 2 Q015 01 14 ee a A a a A 15 AA A A MA AA Boers Gat ok oe ew ee ee to Swe ee 15 45 0 20 2015 01 08 p s iie 444 Re REESE LP RRR AEDS PORES ESS eed 15 46 OITIS pres aaee e a A A ae GR eee oS e Bees 16 4T OLEMI cs eee oe GA ea ee a ee A a EG Re ee A eo ee 8 16 48 QLS 2OU4EVTEIG x else ae ac Bosh he ee eG Bo a ee SA BAO de eh BD ak a Ga GOH 16 40 OTAQI A 16 10 10 1 3 204 1118 a 3 Sa sh tae odios hs We othe Bree a al Ey Soe ok a 16 AAT OZRETI 6 va eee Sy oe et eR RA EA EA RE we ee ee OSES ERAS e a 17 412 Osl A GOAT LATO ecc ae teed a e ae Be PS Hw Ha Sow ER ee S 17 IE O ON B
6. gt gt gt fmt Println i 2 gt gt gt Terminate Gosh to reset main declarations or declare func main without body GOSH bin gosh gt gt gt Y 1 gt gt gt fmt Println i Ll gt gt gt func main gt gt gt fmt Println i error command line arguments gosh_tmp go 8 undefined i gt gt gt 1 1 Documentation 5 Gosh Documentation Release 0 2 3 Limitations e fmt Printx are executed only once Known issues Fail to evaluate when there are declared and not used valiables SGOPATH bin gosh gt gt gt i 1 gt gt gt fmt Println hello gt gt gt 1 1 6 Roadmap e Tab completion e Enable to omit import statement for global system installed packages 1 1 7 License Gosh is licensed under GPLv3 6 Chapter 1 Gosh interactive shell for golang CHAPTER 2 User Manual 2 1 Run Gosh 2 1 1 Automatically installing goimports gt v0 3 0 Note We recommend that you install goimports to SPATH in advance e Installing automatically if the command is not found in PATH e However the time until the installation is complete in this case you will be waiting for the launch of Gosh process 2 1 2 Check version SGOPATH bin gosh version version v0O x x 2 1 3 Basic mode SGOPATH bin gosh go version gol 3 3 linux amd64 Gosh v0O x x Copyright C 2014 2015 Kouhei Maeda License GPLv3
7. oe oe 17 5 Indices and tables 19 Gosh Documentation Release 0 2 3 Contents Contents 1 Gosh Documentation Release 0 2 3 2 Contents CHAPTER 1 Gosh interactive shell for golang Gosh is the interactive Golang shell The goal is to provide an easy to use interactive execution environment 1 1 Documentation http gosh readthedocs org 1 1 1 Features Interactive shell Enable to omit the main function Enable to omit package statement Enable to omit the import statement of standard library Enable to Import libraries of non standard library Enable to re declare function type Ignoring duplicate import package Ignoring unused import package 1 1 2 Requirements e Golang gt 1 2 e goimports command We recommend that you install goimports to SPATH in advance Installing automatically if the command is not found in PATH gt v0 3 0 However the time until the installation is complete in this case you will be waiting for the launch of Gosh process Gosh Documentation Release 0 2 3 for documentation e libpython2 7 dev e libjpeg9 dev 1 1 3 Installation Debian Install the following packages e golang e golang go tools recommended Set GOPATH install d path to gopath export GOPATH path to gopath If you install goimports in advance recommended sudo apt get install y golang go tools Install Gosh to GOPATH
8. t bar hello gt gt gt func bar gt gt gt fmt Println bye gt gt gt gt gt gt bar bye bye 2 7 Declaration of function 11 Gosh Documentation Release 0 2 3 12 Chapter 2 User Manual CHAPTER 3 Internals No Name Description 0 run User executeted SGOPATH bin gosh Gosh 1 prompt User is able to input commands 2 parse Gosh parse from inputted command 3 go get Gosh executes go get example org sompkg when user inputted import example org somepkg 4 write Gosh write Stmpdir gosh gosh_tmp go when user inputted main func include omitted main 5 goim Gosh executes goimport Stmpdir gosh gosh_tmp go port 6 go run Gosh executes go run Stmpdir gosh gosh_tmp go 99 termi User inputted Ct r1 D nate 0 5 goim Gosh executes go get code google com p go tools cmd goimport if ports goimports command is not found 13 Gosh Documentation Release 0 2 3 14 Chapter 3 Internals CHAPTER 4 History 4 1 0 3 0 not release e Re declaration of type e Added user documentation e Automatically installing goimports e Added sudo E go run option s sudopassword 4 2 0 2 3 2015 01 18 e Fixed not running multiple gosh processes 4 3 0 2 2 2015 01 14 e Fixed input unnecessary Enter 4 4 0 2 1 2015 01 13 e Fixed declared function is executing immediately after f
9. tement 16 Chapter 4 History Gosh Documentation Release 0 2 3 4 11 0 1 2 2014 11 12 e Changed to print error of runCmd e Suppressed go install no install location e Fixed lacking newline when writing 4 12 0 1 1 2014 11 10 e Fixed deadlock occurs when typing Ct r1 D immediately after gosh start e Fixed fail override tmp code file 4 13 0 1 0 2014 11 09 e First release 4 11 0 1 2 2014 11 12 17 Gosh Documentation Release 0 2 3 18 Chapter 4 History CHAPTER 5 Indices and tables e genindex e modindex e search 19
10. unc main 4 5 0 2 0 2015 01 08 e Enable to omit the main function e Enable to re declare function e refactoring of parser import type function declaration with go scanner go token instead of regexp e Added parser of typeDecl e Fixed some bugs e Added to execute go get for goimports in Makefile 15 Gosh Documentation Release 0 2 3 e Applied golint go vet 4 6 0 1 7 2014 11 28 e Supported struct method and pointer parameters and results of function e Supported type of function e Appended func parser e Fixes allowing blanks of the begening of ImportDecl e Fixed Installation syntax of README 4 7 0 1 6 2014 11 23 e Supported patterns of ImportDecl supported by go run for example PackageName importPath syntax e Supported patterns of PackageClause supported by go run 4 8 0 1 5 2014 11 16 e Unsupported Go 1 1 e Added goVersion printing license e Appended GPLv3 copying permission statement e Appended printFlag argument to runCmd 4 9 0 1 4 2014 11 15 e Fixed not work go run when noexistent package in parser importPkgs e Changed log Printf instead of log Fatalf when error case at logger e Changed appending message string to returns of runCmd 4 10 0 1 3 2014 11 13 e Fixed runtime error occurs when invalid import statement e Fixes issue infinite loop of go get e Cleanup all working directories on boot e Cleard parser body when non declaration sta
Download Pdf Manuals
Related Search
Related Contents
Targus Incognito Backpack TOWER FAN スポッとチェア 取扱説明書 Viper DC servomotor drive Manual V2.0.1 Lista de verificación de seguridad para mantenimiento USER MANUAL Fujifilm YV2.1X2.8SR4A-SA2 User's Manual File VMIX 2002 24/48 - Illumino Service S.r.l. Copyright © All rights reserved.
Failed to retrieve file