This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
язык_программирования_golang [2023/05/05 12:45] val |
язык_программирования_golang [2023/08/15 10:15] val |
||
---|---|---|---|
Line 6: | Line 6: | ||
<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 23: | ||
) | ) | ||
+ | const ver = "ver1.1" | ||
func main() { | func main() { | ||
Line 31: | Line 38: | ||
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 46: | ||
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> |