Here's the canonical TOML example from the TOML README, and a YAML version of the same. Which looks nicer?
|
| // A small SSH daemon providing bash sessions | |
| // | |
| // Server: | |
| // cd my/new/dir/ | |
| // #generate server keypair | |
| // ssh-keygen -t rsa | |
| // go get -v . | |
| // go run sshd.go | |
| // | |
| // Client: |
| package main | |
| import ( | |
| "bytes" | |
| "encoding/gob" | |
| "fmt" | |
| ) | |
| type MyFace interface { | |
| A() |
| package main | |
| import ( | |
| "errors" | |
| "runtime" | |
| "unsafe" | |
| "golang.org/x/mobile/app" | |
| "golang.org/x/mobile/event/lifecycle" | |
| "golang.org/x/mobile/event/paint" |
Here's the canonical TOML example from the TOML README, and a YAML version of the same. Which looks nicer?
|
| package main | |
| import ( | |
| "net" | |
| "os/exec" | |
| "github.com/k0kubun/pp" | |
| ) | |
| func Hosts(cidr string) ([]string, error) { |
| {"hola":"mundo","number":1} |
| package main | |
| import ( | |
| "fmt" | |
| "io" | |
| "net" | |
| "os" | |
| "sync" | |
| ) |
| // https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works | |
| package main | |
| import ( | |
| "fmt" | |
| "golang.org/x/crypto/ssh" | |
| ) | |
| const privateKey = `content of id_rsa` |
| go build helloworld.go | |
| GOOS=windows GOARCH=amd64 go build helloworld.go |
| #!/bin/bash | |
| # call this script with an email address (valid or not). | |
| # like: | |
| # ./makecert.sh joe@random.com | |
| mkdir certs | |
| rm certs/* | |
| echo "make server cert" | |
| openssl req -new -nodes -x509 -out certs/server.pem -keyout certs/server.key -days 3650 -subj "/C=DE/ST=NRW/L=Earth/O=Random Company/OU=IT/CN=www.random.com/emailAddress=$1" | |
| echo "make client cert" | |
| openssl req -new -nodes -x509 -out certs/client.pem -keyout certs/client.key -days 3650 -subj "/C=DE/ST=NRW/L=Earth/O=Random Company/OU=IT/CN=www.random.com/emailAddress=$1" |