Build Web Application With Golang - Programmer Books

1y ago
32 Views
2 Downloads
1.63 MB
327 Pages
Last View : 1d ago
Last Download : 2m ago
Upload by : Asher Boatman
Transcription

Table of ContentsIntroduction1.1Go Environment Configuration1.2Installation1.2.1 GOPATH and workspace1.2.2Go commands1.2.3Go development tools1.2.4Summary1.2.5Go basic knowledge1.3Hello, Go1.3.1Go foundation1.3.2Control statements and face1.3.6Concurrency1.3.7Summary1.3.8Web foundation1.4Web working principles1.4.1Build a simple web server1.4.2How Go works with web1.4.3Get into http package1.4.4Summary1.4.5HTTP Form1.5Process form inputs1.5.1Validation of inputs1.5.2Cross site scripting1.5.3Duplicate submissions1.5.4File upload1.5.5Summary1.5.6Database1.6database/sql interface1.6.1How to use MySQL1.6.2How to use SQLite1.6.3How to use PostgreSQL1.6.4How to use beedb ORM1.6.5NOSQL1.6.6Summary1.6.7Data storage and session1.7Session and cookies1.7.12

How to use session in Go1.7.2Session storage1.7.3Prevent hijack of session1.7.4Summary1.7.5Text Files1.8.5Strings1.8.6Summary1.8.7Web .9.4Summary1.9.5Security and encryption1.10CSRF attacks1.10.1Filter inputs1.10.2XSS attacks1.10.3SQL injection1.10.4Password storage1.10.5Encrypt and decrypt data1.10.6Summary1.10.7Internationalization and localization1.11Time zone1.11.1Localized resources1.11.2International sites1.11.3Summary1.11.4Error handling, debugging and testing1.12Error handling1.12.1Debugging by using GDB1.12.2Write test cases1.12.3Summary1.12.4Deployment and maintenance1.13Logs1.13.1Errors and crashes1.13.2Deployment1.13.3Backup and recovery1.13.4Summary1.13.53

Build a web framework1.14Project program1.14.1Customized routers1.14.2Design controllers1.14.3Logs and configurations1.14.4Add, delete and update blogs1.14.5Summary1.14.6Develop web framework1.15Static files1.15.1Session1.15.2Form1.15.3User validation1.15.4Multi-language 6preface1.174

IntroductionBuild Web Application with GolangPurposeBecause I'm interested in web application development, I used my free time to write this book as an open source version. Itdoesn't mean that I have a very good ability to build web applications; I would like to share what I've done with Go inbuilding web applications.For those of you who are working with PHP/Python/Ruby, you will learn how to build a web application with Go.For those of you who are working with C/C , you will know how the web works.I believe the purpose of studying is sharing with others. The happiest thing in my life is sharing everything I've known withmore people.DonatealipayAliPay:English //gocn.io/Acknowledgments四月份平民 April Citizen (review code)洪瑞琦 Hong Ruiqi (review code)边 疆 BianJiang (write the configurations about Vim and Emacs for Go development)欧林猫 Oling Cat(review code)吴文磊 Wenlei Wu(provide some pictures)北极星 Polaris(review whole book)雨 痕 Rain Trail(review chapter 2 and 3)LicenseThis book is licensed under the CC BY-SA 3.0 License, the code is licensed under a BSD 3-Clause License, unlessotherwise specified.Get StartedIndex5

Introduction6

Go Environment Configuration1 Go Environment ConfigurationWelcome to the world of Go, let's start exploring!Go is a fast-compiled, garbage-collected, concurrent systems programming language. It has the following advantages:Compiles a large project within a few seconds.Provides a software development model that is easy to reason about, avoiding most of the problems associated withC-style header files.Is a static language that does not have levels in its type system, so users do not need to spend much time dealing withrelations between types. It is more like a lightweight object-oriented language.Performs garbage collection. It provides basic support for concurrency and communication.Designed for multi-core computers.Go is a compiled language. It combines the development efficiency of interpreted or dynamic languages with the security ofstatic languages. It is going to be the language of choice for modern, multi-core computers with networking. For thesepurposes, there are some problems that need to inherently be resolved at the level of the language of choice, such as arichly expressive lightweight type system, a native concurrency model, and strictly regulated garbage collection. For quitesome time, no packages or tools have emerged that have aimed to solve all of these problems in a pragmatic fashion; thuswas born the motivation for the Go language.In this chapter, I will show you how to install and configure your own Go development environment.LinksDirectoryNext section: Installation7

Installation1.1 InstallationThree ways to install GoThere are many ways to configure the Go development environment on your computer, and you can choose whichever oneyou like. The three most common ways are as follows.Official installation packages.The Go team provides convenient installation packages in Windows, Linux, Mac and other operating systems.This is probably the easiest way to get started. You can get the installers from the Golang Download Page.Install it yourself from source code.Popular with developers who are familiar with Unix-like systems.Using third-party tools.There are many third-party tools and package managers for installing Go, like apt-get in Ubuntu and homebrew forMac.In case you want to install more than one version of Go on a computer, you should take a look at a tool called GVM. It is thebest tool I've seen so far for accomplishing this task, otherwise you'd have to deal with it yourself.Install from source codeTo compile Go 1.5 and upwards, you only need the previous version of Go, as Go has achieved bootstrapping. You onlyneed Go to compile Go.To compile Go 1.4 downwards, you will need a C compiler as some parts of Go are still written in Plan 9 C and AT&Tassembler.On a Mac, if you have installed Xcode, you already have the compiler.On Unix-like systems, you need to install gcc or a similar compiler. For example, using the package manager apt-get(included with Ubuntu), one can install the required compilers as follows:sudo apt-get install gcc libc6-devOn Windows, you need to install MinGW in order to install gcc. Don't forget to configure your environment variables afterthe installation has completed.( Everything that looks like this means it's commented by a translator: If you are using64-bit Windows, you should install the 64-bit version of MinGW )At this point, execute the following commands to clone the Go source code and compile it.( It will clone the source codeto your current directory. Switch your work path before you continue. This may take some time. )git clone https://go.googlesource.com/gocd go/src./all.bashA successful installation will end with the message "ALL TESTS PASSED."On Windows, you can achieve the same by runningall.bat.If you are using Windows, the installation package will set your environment variables automatically. In Unix-like systems,you need to set these variables manually as follows. ( If your Go version is greater than 1.0, you don't have to set GOBIN, and it will automatically be related to your GOROOT/bin, which we will talk about in the next section)8

Installationexport GOROOT HOME/goexport GOBIN GOROOT/binexport PATH PATH: GOROOT/binIf you see the following information on your screen, you're all set.Figure 1.1 Information after installing from source codeOnce you see the usage information of Go, it means you have successfully installed Go on your computer. If it says "nosuch command", check that your PATH environment variable contains the installation path of Go.Using the standard installation packagesGo has one-click installation packages for every supported operating system. These packages will install Go in/usr/local/go(c:\Goin Windows) by default. Of course this can be modified, but you also need to change all theenvironment variables manually as I've shown above.How to check if your operating system is 32-bit or 64-bit?Our next step depends on your operating system type, so we have to check it before we download the standard installationpackages.If you are using Windows, pressWin Rand then run the command tool. Type thesysteminfocommand and it will showyou some useful system information. Find the line that says "system type" -if you see "x64-based PC" that means youroperating system is 64-bit, 32-bit otherwise.I strongly recommend downloading the 64-bit package if you are a Mac user, as Go no longer supports pure 32-bitprocessors on Mac OSX.Linux users can typeuname -ain the terminal to see system information. A 64-bit operating system will show the following: some description x86 64 x86 64 x86 64 GNU/Linux// some machines such as Ubuntu 10.04 will show as followingx86 64 GNU/Linux32-bit operating systems instead show: some description i686 i686 i386 GNU/LinuxMacGo to the download page, 6.pkg(The later version has no 32-bit download.)for 32-bit systemsfor 64-bit systems. Going all the way to the end by clicking "next",to your system's PATH after you finish the installation. Now open the terminal and typego /go/binwill be added. You should see the sameoutput shown in figure 1.1.LinuxGo to the download page, choosego1.8.3.linux-386.tar.gzsystems. Suppose you want to install Go in thethe commandfor 32-bit systems and GO INSTALL DIRpath. Uncompress thetar zxvf go1.8.3.linux-amd64.tar.gz -C GO INSTALL DIRPATH PATH: GO INSTALL DIR/go/bingo1.8.3.linux-amd64.tar.gztar.gzto your chosen path using. Then set your PATH with the following:. Now just open the terminal and typegofor 64-bitexport. You should now see the same outputdisplayed in figure 1.1.9

InstallationWindowsGo to the download page, choosego1.8.3.windows-386.msisystems. Going all the way to the end by clicking "next",window and typegofor 32-bit systems andc:/go/binwill be added togo1.8.3.windows-amd64.msipathfor 64-bit. Now just open a command line. You should now see the same output displayed in figure 1.1.Use third-party toolsGVMGVM is a Go multi-version control tool developed by a third-party, like rvm for ruby. It's quite easy to use. Install gvm bytyping the following commands in your terminal:bash (curl -s -S -L ts/gvm-installer)Then we install Go using the following commands:gvm install go1.8.3gvm use go1.8.3After the process has finished, you're all set.apt-getUbuntu is the most popular desktop release version of Linux. It usesapt-getto manage packages. We can install Gousing the following commands.sudo add-apt-repository ppa:gophers/gosudo apt-get updatesudo apt-get install golang-gowgetwget x-amd64.tar.gzsudo tar -xzf go1.8.3.linux-amd64.tar.gz -C /usr/local# Go environmentexport GOROOT /usr/local/goexport GOBIN GOROOT/binexport PATH PATH: GOBINexport GOPATH HOME/gopathStarting from go 1.8, The GOPATH environment variable now has a default value if it is unset. It defaults toUnix and%USERPROFILE%/go HOME/goonon Windows.HomebrewHomebrew is a software management tool commonly used in Mac to manage packages. Just type the following commandsto install Go.1. Install Homebrew/usr/bin/ruby -e " (curl -fsSL /master/install)"10

Installation1. Install Gobrew update && brew upgradebrew install goLinksDirectoryPrevious section: Go environment configurationNext section: GOPATH and workspace11

GOPATH and workspace1.2 GOPATH and workspace GOPATHGo takes a unique approach to manage the code files with the introduction of acode in the machine. Note that this is different from thethe machine. We have to define the.profile GOROOT GOPATHdirectory which contains all the goenvironment variable which states where go is installed onvariable before using the language, in *nix systems there is a file called GOPATHwe need to append the below export statement to the file. The concept behind gopath is a novel one, where wecan link to any go code at any instant of time without ambiguity.Starting from go 1.8, the GOPATH environment variable now has a default value if it is unset. It defaults toUnix and%USERPROFILE%/go HOME/goonon Windows.In Unix-like systems, the variable should be used like this:export GOPATH {HOME}/mygoIn Windows, you need to create a new environment variable called GOPATH, then set its value toc:\mygo( This valuedepends on where your workspace is located )It's OK to have more than one path (workspace) inbreak them up. At this point,go get GOPATH, but remember that you have to usewill save the content to your first path in GOPATH:(;in Windows) to. It is highly recommended to nothave multiples versions, the worst case is to create a folder by the name of your project right inside GOPATH, it breakseverything that the creators were wishing to change in programming with the creation of go language because when youcreate a folder inside GOPATHyou will reference your packages as directly as , and this breaks all the applications whichwill import your package because thego getwon't find your package. Please follow conventions, there is a reasonconventions are created.In GOPATH, you must have three folders as follows:srcfor source files whose suffix is .go, .c, .g, .s.pkgfor compiled files whose suffix is .a.binfor executable filesIn this book, I usemygoas my only path in GOPATH.Package directoryCreate package source files and folders likemymath GOPATH/src/mymath/sqrt.go(mymathis the package name) ( Author usesas his package name, and the same name for the folder that contains the package source files)Every time you create a package, you should create a new folder in thefor whichmainsrcdirectory, with the notable exception of main,folder creation is optional. Folder names are usually the same as the package that you are going to use.You can have multi-level directories if you want to. For example, if you create the directory GOPATH/src/github.com/astaxie/beedb, then the package path would bebe the last directory in your path, which isbeedbgithub.com/astaxie/beedb. The package name willin this case.Execute following commands. ( Now author goes back to talk examples )cd GOPATH/srcmkdir mymathCreate a new file calledsqrt.go, type the following content to your file.12

GOPATH and workspace// Source code of GOPATH/src/mymath/sqrt.gopackage mymathfunc Sqrt(x float64) float64 {z : 0.0for i : 0; i 1000; i {z - (z*z - x) / (2 * x)}return z}Now my package directory has been created and it's code has been written. I recommend that you use the same name foryour packages as their corresponding directories, and that the directories contain all of the package source files.Compile packagesWe've already created our package above, but how do we compile it for practical purposes? There are two ways to do this.1. Switch your work path to the directory of your package, then execute the2. Execute the above command except with a file name, likego installgo install mymathcommand.After compiling, we can open the following folder.cd GOPATH/pkg/ {GOOS} {GOARCH}// you can see the file was generatedmymath.aThe file whose suffix is.ais the binary file of our package. How do we use it?Obviously, we need to create a new application to use it.Create a new application package calledmathapp.cd GOPATH/srcmkdir mathappcd mathappvim main.goWrite the following content to main.go.// GOPATH/src/mathapp/main.go source code.package mainimport ("mymath""fmt")func main() {fmt.Printf("Hello, world. Sqrt(2) %v\n", mymath.Sqrt(2))}To compile this application, you need to switch to the application directory, which in this case isexecute the GOPATH/bin/go installcommand. Now you should see an executable file called. To run this program, use the./mathappmathapp GOPATH/src/mathapp, thenwas generated in the directorycommand. You should see the following content in your terminal.Hello world. Sqrt(2) 1.41421356237309513

GOPATH and workspaceInstall remote packagesGo has a tool for installing remote packages, which is a command calledgo get. It supports most open sourcecommunities, including Github, Google Code, BitBucket, and Launchpad.go get github.com/astaxie/beedbYou can usego get -u to update your remote packages and it will automatically install all the dependent packages aswell.This tool will use different version control tools for different open source platforms. For example,for Google Code. Therefore, you have to install these version control tools before you usegitgo getfor Github andhg.After executing the above commands, the directory structure should look like following. GOPATHsrc -github.com -astaxie -beedbpkg -- {GOOS} {GOARCH} -github.com -astaxie -beedb.aActually,go getclones source code to theof the local file system, then executes GOPATH/srcgo install.You can use remote packages in the same way that we use local packages.import "github.com/astaxie/beedb"Directory complete structureIf you've followed all of the above steps, your directory structure should now look like the following.bin/mathapppkg/ {GOOS} {GOARCH}, such as darwin amd64, linux b.goutil.goNow you are able to see the directory structure clearly;srcbincontains executable files,pkgcontains compiled files andcontains package source files.(The format of environment variables in Windows is%GOPATH%, however this book mainly follows the Unix-style, soWindows users need to replace these yourself.)14

GOPATH and workspaceLinksDirectoryPrevious section: InstallationNext section: Go commands15

Go commands1.3 Go commandsGo commandsThe Go language comes with a complete set of command operation tools. You can execute thegocommand on theterminal to see them:Figure 1.3 Go command displays detailed informationThese are all useful for us. Let's see how to use some of them.go buildThis command is for compiling tests. It will compile packages and dependencies if it's necessary.If the package is not thego buildmainpackage such as. If you need the package fileIf the package is thegenerated inmain GOPATH/bin.ainin section 1.2, nothing will be generated after you executemymath, use GOPATH/pkggo installinstead.package, it will generate an executable file in the same folder. If you want the file to be, usego installorgo build -o {PATH HERE}/a.exe.If there are many files in the folder, but you just want to compile one of them, you should append the file name afterbuild. For example,go build a.go.go buildwill compile all the files in the folder.You can also assign the name of the file that will be generated. For instance, in theusinggo build -o astaxie.exewill generategoastaxie.exeinstead ofmathapp.exemathappproject (in section 1.2),. The default name is your foldername (non-main package) or the first source file name (main package).(According to The Go Programming Language Specification, package names should be the name after the wordpackagein the first line of your source files. It doesn't have to be the same as the folder name, and the executable file name will beyour folder name by default.)go buildignores files whose names start withor.If you want to have different source files for every operating system, you can name files with the system name as asuffix. Suppose there are some source files for loading arrays. They could be named as follows:array linux.go array darwin.go array windows.go array freebsd.gogo buildchooses the one that's associated with your operating system. For example, it only compiles array linux.go inLinux systems, and ignores all the others.go cleanThis command is for cleaning files that are generated by compilers, including the following files:obj/// old directory of object, left by Makefilestest/// old directory of test, left by Makefilestestmain.go// old directory of gotest, left by Makefilestest.out// old directory of test, left by Makefilesbuild.out// old directory of test, left by Makefiles*.[568ao]// object files, left by MakefilesDIR(.exe)// generated by go buildDIR.test(.exe)// generated by go test -cMAINFILE(.exe)// generated by go build MAINFILE.go16

Go commandsI usually use this command to clean up my files before I upload my project to Github. These are useful for local tests, butuseless for version control.go fmt and gofmtThe people who are working with C/C should know that people are always arguing about which code style is better:K&R-style or ANSI-style. However in Go, there is only one code style which is enforced. For example, left braces must onlybe inserted at the end of lines, and they cannot be on their own lines, otherwise you will get compile errors! Fortunately, youdon't have to remember these rules.go fmtdoes this job for you. Just execute the commandgo fmt File name .gointerminal. I don't use this command very much because IDEs usually execute this command automatically when you savesource files. I will talk more about IDEs in the next section.go fmtis just an alias, which runs the command 'gofmt -l -w' on the packages named by the import paths.We usually usesrcgofmt -winstead ofgo fmt. The latter will not rewrite your source files after formatting code.gofmt -wformats the whole project.go getThis command is for getting remote packages. So far, it supports BitBucket, Github, Google Code and Launchpad. Thereare actually two things that happen after we execute this command. The first thing is that Go downloads the source code,then executesgo install. Before you use this command, make sure you have installed all of the related tools.BitBucket (Mercurial Git)Github (git)Google Code (Git, Mercurial, Subversion)Launchpad (Bazaar)In order to use this command, you have to install these tools correctly. Don't forget to update theway, it also supports customized domain names. Usego help importpath PATHvariable. By thefor more details about this.go installThis command compiles all packages and generates files, then moves them to GOPATH/pkgor GOPATH/bin.go testThis command loads all files whose name include* test.goand generates test files, then prints information that looks likethe following.okarchive/tar0.011sFAIL archive/zip0.022sokcompress/gzip 0.033s.It tests all your test files by default. Use commandgo help testflagfor more details.godocMany people say that we don't need any third-party documentation for programming in Go (actually I've made a CHMalready). Go has a powerful tool to manage documentation natively.17

Go commandsSo how do we look up package information in documentation? For instance, if you want to get more details about thebuiltinpackage, use thegodoc builtincommand. Similarly, use thegodoc net/httpcommand to look up thepackage documentation. If you want to see more details about specific functions, use thesrc fmt PrintfExecute thegodoc fmt Printfandhttpgodoc -commands to view the source code.godoc -http :8080command, then open127.0.0.1:8080in your browser. You should see a localizedgolang.org. It can not only show the standard packages' information, but also packages in your GOPATH/pkg. It's great forpeople who are suffering from the Great Firewall of China.Other commandsGo provides more commands than those we've just talked about.go fix // upgrade code from an old version before go1 to a new version after go1go version // get information about your version of Gogo env // view environment variables about Gogo list // list all installed packagesgo run // compile temporary files and run the applicationThere are also more details about the commands that I've talked about. You can usego help command to look them up.LinksDirectoryPrevious section: GOPATH and workspaceNext section: Go development tools18

Go development toolsGo development toolsIn this section, I'm going to show you a few IDEs that can help you become a more efficient programmer, with capabilitiessuch as intelligent code completion and auto-formatting. They are all cross-platform, so the steps I will be showing youshould not be very different, even if you are not using the same operating system.LiteIDELiteIDE is an open source, lightweight IDE for developing Go projects only, developed by visualfc.Figure 1.4 Main panel of LiteIDELiteIDE features.Cross-platformWindowsLinuxMac OSCross-compileManage multiple compile environmentsSupports cross-compilation of GoProject management standardDocumentation view based on GOPATHCompilation system based on GOPATHAPI documentation index based on GOPATHGo source code editorCode outliningFull support of gocodeGo documentation view and API indexView code expression usingF1Function declaration jump usingF2Gdb supportAuto-format withgofmtOthersMulti-languagePlugin systemText editor themesSyntax support based on Kateintelligent completion based on full-textCustomized shortcutsMarkdown supportReal-time previewCustomized CSSExport HTML and PDFConvert and merge to HTML and PDFLiteIDE installationInstall LiteIDEDownload page19

Go development toolsSource codeYou need to install Go first, then download the version appropriate for your operating system. Decompress thepackage to directly use it.Install gocodeYou have to install gocode in order to use intelligent completiongo get -u github.com/nsf/gocodeCompilation environmentSwitch configuration in LiteIDE to suit your operating system. In Windows and using the 64-bit version of Go, youshould choose win64 as the configuration environment in the tool bar. Then, chooselist and open filewin64.envOptions, findLiteEnvin the leftin the right list.GOROOT c:\goGOBIN GOARCH amd64GOOS windowsCGO ENABLED 1PATH %GOBIN%;%GOROOT%\bin;%PATH%。。。ReplaceGOROOT c:\goto your Go installation path, save it. If you have MinGW64, addenvironment variable forcgoc:\MinGW64\binto your pathsupport.In Linux and using the 64-bit version of Go, you should choose linux64 as the configuration environment in the tool bar.Then, chooseOptions, findLiteEnvin the left list and open thelinux64.envfile in the right list.GOROOT HOME/goGOBIN GOARCH amd64GOOS linuxCGO ENABLED 1PATH GOBIN: GOROOT/bin: PATH。。。ReplaceGOROOT HOME/goto your Go installation path, save it. GOPATH GOPATH is the path that contains a list of projects. Open the command tool (or pressthen typego help gopathSetup GOPATHCtrl for more details. It's very easy to view and change GOPATH in LiteIDE. Followin LiteIDE),View -to view and change these values.Sublime TextHere I'm going to introduce you the Sublime Text 3 (Sublime for short) GoSublime gocode. Let me explain why.Intelligent completionFigure 1.5 Sublime intelligent completionAuto-format source filesProject management20

Go development toolsFigure 1.6 Sublime project managementSyntax highlightFree trial forever with no functional limitations. You may be prompted once in a while to remind you to purchase alicense, but you can simply ignore it if you wish. Of course, if you do find that it enhances your productivity and youreally enjoy using it, please purchase a copy of it and support its continued development!First, download the version of Sublime suitable for your operating system.1. PressCtrl , open the command tool and input the following commands.Applicable to Sublime Text 3:importurllib.request,os;pf 'Package Control.sublime-package';ipp sublime.installed packages path();urllib.request.install opener(urllib.request.build 'http://sublime.wbond.net/' pf.replace(' ','%20')).read())Applicable to Sublime Text 2:importurllib2,os;pf 'Package Control.sublime-package';ipp sublime.installed packages eNone;urllib2.install opener(urllib2.build e.wbond.net/' pf.replace(' ','%20')).read());print('Please restart Sublime Text to finish installation')Restart Sublime Text when the installation has finished. You should then find a Package Control option in the "Preferences" menu.![](images/1.4.sublime3.png?raw true)Figure 1.7 Sublime Package Control1. To install GoSublime, SidebarEnhancements and Go Build, presspcipCtrl Shift pto open Package Control, then type(short for "Package Control: Install Package").Figure 1.8 Sublime Install PackagesNow type in "GoSublime", press OK to install the package, and repeat the same steps for installingSidebarEnhancements and Go Build. Once again, restart the editor when it completes the installation.2. To verify that the installation is successful, open Sublime, then open thehighlighting. Typeafter theimportimportmain.goto see if code completion prompts appear. After typingfile to see if it has the proper syntaximport "fmt", typefmt.anywheredeclaration to see whether or not intelligent code completion for functions was successfully enabled.If everything is fine, you're all set.If not, check your PATH again. Open a terminal, typegocode. If it does not run, your PATH was not configuredcorrectly.VimVim is a popular text editor for programmers, which evolved from its slimmer predecessor, Vi. It has functions for intelligentcompletion, compilation and jumping to errors.vim-go is vim above an open-source go language using the most extensive development environment plug-insThe plugin address:github.com/fatih/vim-go21

Go development toolsVim plugin management are the mainstream Pathogen and Vundle ,But the aspects thereof are different. Pathogen is tosolve each plug-in after the installation of files scattered to multiple directories and poor management of the existence.Vundle is to solve the automatic search and download plug-ins exist. These two plug-ins can be used simultaneously.1.Install Vundlemkdir /.vim/bundlegit clone https://github.com/gmarik/Vundle.vim.git /.vim/bundle/Vundle.vimEdit .vimrc,Vundle the relevant configuration will be placed in the beginning(Refer to the Vundle

Build Web Application with Golang Purpose Because I'm interested in web application development, I used my free time to write this book as an open source version. It doesn't mean that I have a very good ability to build web applications; I would like to share what I've done with Go in building web applications.

Related Documents:

pembangkit. Spesifikasi waduk PLTA Golang dapat dilihat pada Tabel 2.1 berikut. Tabel 2.1 Spesifikasi Waduk PLTA Golang Parameter Waduk PLTA Golang Tipe Kolam Tando Harian Kapasitas maksimal 20.000 m3 Isi efektif 310.000 m Panjang 333 m Lebar 20 m Luas KTH 6.660 m2 Tinggi 3 m Pada KTH PLTA Golang terdiri dari: a. Saluran tertutup/terowongan

golang-nuts@golang.org: user discussion golang-dev@golang.org: developers Wednesday, June 15, 2011. Course Outline Day 1 Basics Day 2 Types, methods, and interfaces Day 3 Concurrency and communication This course is about programming in Go, not about programming language design. That is the topic of a separate talk, not yet on line. Wednesday, June 15, 2011. Today’s Outline Motivation Basics .

Golang has lots of core language features and libraries that allows much faster development of applications. 2. The learning curve from C to Golang is very low, given the similarities in the language structure. 3. As it is a compiled language, Golang runs natively on embedded devices. 4. Go is statically linked into a single binary, with no .

Golang (atau biasa disebut dengan Go) adalah bahasa pemrograman baru yang dikembangkan di Google oleh Robert Griesemer, Rob Pike, dan Ken Thompson pada tahun 2007 dan mulai diperkenalkan di publik tahun 2009. Penciptaan bahasa Golang didasari bahasa C dan C , oleh karena itu gaya sintaks-nya mirip. Kelebihan Golang

popular sites hosting Golang projects, namely, Bitbucket [3], GitHub [4], Launchpad [5], and IBM DevOps Services [6]. Among them, GitHub hosts nearly 90% Golang projects (as of June 2020) [7]. While Golang's library-based development boosts its adop-tion, its library-referencing mode has undergone a major change as the language evolves.

Wasm Cooking with GoLang Philippe Charrière To everyone aspiring to have fun when writing software. Acknowledgments Ὢ This is a work in progress

in Golang NikitaTomilova aITMO University, Kronverksky Pr. 49, bldg. A, St. Petersburg, 197101, Russia Abstract Due to the recent growth in popularity of the Internet of Things solutions, the amount of data being captured, stored, and transferred is also significantly increasing. The concept of edge devices allows

The effects of using a more efficient insulation don’t appear to be much at face value, but factor in a minimum 30-year life-cycle cost of operating