User Tools

Site Tools


язык_программирования_golang

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
язык_программирования_golang [2023/05/05 12:45]
val
язык_программирования_golang [2023/10/31 10:08] (current)
val
Line 4: Line 4:
   * [[https://​www.digitalocean.com/​community/​tutorials/​how-to-build-and-install-go-programs|How To Build and Install Go Programs]]   * [[https://​www.digitalocean.com/​community/​tutorials/​how-to-build-and-install-go-programs|How To Build and Install Go Programs]]
   * [[https://​www.systutorials.com/​how-to-get-the-hostname-of-the-node-in-go/​|How to get the hostname of the node in Go?]]   * [[https://​www.systutorials.com/​how-to-get-the-hostname-of-the-node-in-go/​|How to get the hostname of the node in Go?]]
 +
 +  * [[https://​min.io/​docs/​minio/​linux/​developers/​go/​minio-go.html|MinIO Go Client SDK for Amazon S3 Compatible Cloud Storage]]
  
 <​code>​ <​code>​
 +student@client1:​~$ sudo apt install golang-go
 +
 +student@client1:​~$ mkdir gowebd
 +
 +student@client1:​~$ cd gowebd/
 +
 student@client1:​~/​gowebd$ cat main.go student@client1:​~/​gowebd$ cat main.go
 </​code><​code>​ </​code><​code>​
Line 17: Line 25:
 ) )
  
 +const ver = "​ver1.1"​
  
 func main() { func main() {
Line 31: Line 40:
                 panic(err)                 panic(err)
         }         }
-        fmt.Fprint(w,​ "Hello world from " + name + " ​ver1.1\n")+        fmt.Fprint(w,​ "Hello world from " + name + " ​" + ver + "\n")
 } }
 </​code><​code>​ </​code><​code>​
Line 39: Line 48:
  
 student@client1:​~/​gowebd$ sudo go build -o /​usr/​local/​sbin/​gowebd student@client1:​~/​gowebd$ sudo go build -o /​usr/​local/​sbin/​gowebd
 +
 +student@client1:​~/​gowebd$ sudo /​usr/​local/​sbin/​gowebd
 </​code>​ </​code>​
язык_программирования_golang.1683279933.txt.gz · Last modified: 2023/05/05 12:45 by val