See also, http://libraryofalexandria.io/cgo/
cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.
So, Here collect materials.
| package main | |
| import ( | |
| "io" | |
| "log" | |
| "os" | |
| "github.com/gin-gonic/gin" | |
| ) |
| #for not running docker, use save: | |
| docker save <dockernameortag> | gzip > mycontainer.tgz | |
| #for running or paused docker, use export: | |
| docker export <dockernameortag> | gzip > mycontainer.tgz | |
| #load | |
| gunzip -c mycontainer.tgz | docker load |
| kubectl get namespaces | |
| kubectl get pods --namespace uaa | |
| kubectl get pods --namespace scf | |
| kubectl get pods --namespace stratos | |
| kubectl describe pods uaa-0 --namespace uaa | |
| kubectl describe pods router-0 --namespace scf | |
| kubectl logs -f --namespace uaa uaa-0 uaa |
| git config user.signingkey B48CF8424DDA96E1 | |
| git config commit.gpgsign true | |
| git config user.email "i@tosone.cn" | |
| git config user.name "Tosone" |
| ssh-keygen -t rsa -b 4096 -C "i@tosone.cn" -P "" -f deploy-key |
| package main | |
| import ( | |
| "crypto/md5" | |
| "crypto/rand" | |
| "encoding/binary" | |
| "encoding/hex" | |
| "fmt" | |
| "io" | |
| "os" |
See also, http://libraryofalexandria.io/cgo/
cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.
So, Here collect materials.
| #include <stdio.h> | |
| typedef void (*callback_t)(char *); | |
| void callback_test(char *str) { | |
| printf("%s\n", str); | |
| return; | |
| } | |
| void callback_main(callback_t cb) { |
| import ( | |
| "encoding/binary" | |
| "math" | |
| ) | |
| func Float32ToByte(float float32) []byte { | |
| bits := math.Float32bits(float) | |
| bytes := make([]byte, 4) | |
| binary.LittleEndian.PutUint32(bytes, bits) |
| package main | |
| import ( | |
| "fmt" | |
| "reflect" | |
| "time" | |
| ) | |
| func main() { | |
| type T struct { |