This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
| --- | |
| version: "3.8" | |
| services: | |
| seed: | |
| image: consul:latest | |
| environment: | |
| - "CONSUL_LOCAL_CONFIG={\"disable_update_check\": true}" | |
| - "CONSUL_BIND_INTERFACE=eth0" | |
| entrypoint: |
| --- | |
| version: "3.8" | |
| services: | |
| master: | |
| image: chrislusf/seaweedfs:latest | |
| command: master -mdir=/data | |
| networks: | |
| - weed |
| --- | |
| version: "3.8" | |
| services: | |
| hello: | |
| image: prologic/hello-go | |
| networks: | |
| - traefik | |
| deploy: | |
| mode: replicated |
| module twtxt-search-engine | |
| go 1.14 | |
| require ( | |
| github.com/gocolly/colly/v2 v2.1.0 | |
| github.com/jointwt/twtxt v0.0.0-20210108082814-7098fcfa49df | |
| github.com/prologic/read-file-last-line v0.0.0-20200806014221-326f63458987 | |
| github.com/sirupsen/logrus v1.7.0 | |
| ) |
| --- | |
| version: "3.8" | |
| services: | |
| traefik: | |
| image: traefik:latest | |
| ports: | |
| - target: 80 | |
| published: 80 | |
| protocol: tcp |
| --- | |
| version: "3.8" | |
| services: | |
| hello: | |
| image: r.mills.io/prologic/hello-go | |
| networks: | |
| - traefik | |
| deploy: | |
| mode: replicated |
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
| package main | |
| import ( | |
| "bytes" | |
| "crypto/hmac" | |
| "crypto/md5" | |
| "encoding/hex" | |
| "fmt" | |
| "hash" | |
| "net" |
| <figure> | |
| <a href="pics/earth2150/lc-combat-ucs.jpg"> | |
| <img src="pics/earth2150/lc-combat-ucs.jpg" /> | |
| </a> | |
| <figcaption> | |
| <abbr title="Lunar Corporation">LC</abbr>hovertanks battle mechs guarding a | |
| <abbr title="United Civilized States">UCS</abbr>base. A large mech is shooting rockets at a hovertank, while its shields protect it from an electro cannon attack. Two repairers fix a visibly damaged nuclear power plant.</figcaption> | |
| </figure> |