Solved "syntax error: unexpected end of File" in Linux Shell Scripting.Reference: GO in Practice Categories Programming, GO Post navigation go run hello.go hello, worldĪs you can see from below output, there is no hello executable got created like we had the case in Step 6. This method is only suitable for using in small programs. In a production system, usually go build command is often recommended to build a large number of codes in numerous files. You just have to run go run hello.go command to compile and execute your program. There is another way to run your program without specifically issuing go build command like we did in Step 6. Step 8: Alternative way to run your Program You can see hello, world in the output./hello hello, world Now you need to run your program by using. go buildĪfter the successful build, you can see one executable file hello got created. Please note that i have created a directory hello and written my hello.go program inside that. Once you written your program, it is now time to build your program by using go build command as shown below. We are also importing fmt package from GO Standard Library using import "fmt" keyword to use printf function for displaying the output. Here we have used package main keyword which makes this program to compile as an executable program. Once GO is installed successfully, you can go ahead and write your first Hello World program as shown below. go version go version go1.10.4 linux/amd64 Once installation is completed, you can check the installed GO version by running go version command as shown below. Need to get 1,022 kB/67.4 MB of archives.Īfter this operation, 342 MB of additional disk space will be used. Libitm1 liblsan0 libmpx2 libquadmath0 libstdc++-7-dev libtsan0 libubsan0 linux-libc-dev make manpages-dev pkg-configġ upgraded, 34 newly installed, 0 to remove and 177 not upgraded. Golang-src libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4 libatomic1 libc-dev-bin libc6-dev libcilkrts5 libfakeroot libgcc-7-dev The following NEW packages will be installed:īuild-essential dpkg-dev fakeroot g++ g++-7 gcc gcc-7 golang-1.10-go golang-1.10-race-detector-runtime golang-1.10-src golang-go golang-race-detector-runtime Subversion glibc-doc libstdc++-7-doc make-doc Libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan4-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg libcilkrts5-dbg libmpx2-dbg libquadmath0-dbg bzr mercurial Libgcc-7-dev libitm1 liblsan0 libmpx2 libquadmath0 libstdc++-7-dev libtsan0 libubsan0 linux-libc-dev make manpages-dev pkg-configĭebian-keyring g++-multilib g++-7-multilib gcc-7-doc libstdc++6-7-dbg gcc-multilib autoconf automake libtool flex bison gcc-doc gcc-7-multilib gcc-7-locales Libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4 libatomic1 libc-dev-bin libc6-dev libcilkrts5 libdpkg-perl libfakeroot The following additional packages will be installed:īuild-essential dpkg-dev fakeroot g++ g++-7 gcc gcc-7 golang-1.10-go golang-1.10-race-detector-runtime golang-1.10-src golang-race-detector-runtime golang-src Get:9 stable/main i386 Packages Īfter successful update, it is now time to install Golang package using apt-get install golang-go command as shown below.Īdvertisements apt-get install golang-go Get:8 bionic-security/main i386 Packages Get:7 bionic-updates/main amd64 Packages To provide sudo access to User, you can check How to add User to Sudoers on Ubuntu 18.04Ĭ) You should have apt-get utility available in your System.īefore going through the steps to install GO in your system, you need to update your system by running apt-get update command as shown below. You can use any other user with sudo access to execute all the commands. In this article, I ran all the commands through root user to make things simple and straight. Robert Griesemer, Rob Pike, and Ken Thompson were attempting to create a language for modern systems programming that solved real-world problems they encountered while building large systems at scale.Įasy Steps to Install GO Using APT GET on Ubuntu 18.04Īlso Read: Easy Steps to Install GO Using YUM On CentOS 7 Step 1: PrerequisitesĪ) You require a running Ubuntu 18.04 System.ī) You need to have root access or User with sudo access to run all the privileged commands. Go, sometimes referred to as Golang to make it easier to find on the web, is a statically typed and compiled open source programming language initially developed by Google. In this article, I will take you through the steps to Install GO Using APT GET on Ubuntu 18.04.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |