
Output: Welcome Osradar 2.- Go working properlyĪnd this way it is possible to get Go on OpenSUSE 15.2 Conclusion This will generate a binary that we can execute. Now compile the program: go build first_program } 1.- Hello world program with Go on OpenSUSE 15.2 In our test case, we’ll just do a hello world. nano ~/go_projects/src/first_program/helloworld.goĪnd start creating code. cd ~/go_projects/src/first_programĪnd create the source file with extension go. To create the first program, we have to create inside the project folder a folder called src and inside another folder with the name of our program.įor example: mkdir -p ~/go_projects/src/first_program

Replace the value of GOPATH with the path of the folder created for Go projects. To do this, you must edit the file /etc/profile and add the following lines: export GOPATH=$HOME/go_projects The following is to add some environment variables to the system configuration. The first thing we have to do is create a folder for all our projects with Go. Now we can check the operation of the command Go, showing the installed version. After the operation, additional 614.1 MiB will be used. The following recommended package was automatically selected: Gcc gcc7 glibc-devel go1.15 go1.15-doc go1.15-race libasan4 libatomic1 libcilkrts5 libgomp1 libitm1 liblsan0 libmpx2 libmpxwrappers2 libtsan0 libubsan0 The following 17 NEW packages are going to be installed: At the time of writing is the post the last stable version is 1.15.2 sudo zypper in go1.15 Key Fingerprint: B619E7E2 4D0ED061 FA14343C AF4CFE4D 307D7BF9ĭo you want to reject the key, trust temporarily, or trust always? r/t/a/?: New repository or package signing key received: Now we have to refresh Zypper’s cache to accept the repository’s GPG key.

This ensures that we will always get updates from this repository. The lower the first one is, So the newly added repository has to be reprioritized. OpenSUSE manages the repositories according to the priority they have. So, open a terminal and run the following command: sudo zypper -ar devel
