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.
| // mem out | |
| go test -run none -bench . -benchtime <seconds>s -benchmem -memprofile mem.out | |
| // cpu out | |
| go test -run none -bench . -benchtime <seconds>s -benchmem -cpuprofile cpu.out | |
| // analyze | |
| go tool pprof -alloc_space <dir>.test mem.out |
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "strconv" | |
| "syscall" | |
| "unsafe" | |
| ) |
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 ( | |
| "bytes" | |
| "fmt" | |
| "image" | |
| "image/color" | |
| "image/draw" | |
| _ "image/gif" | |
| "image/jpeg" |
| package main | |
| import ( | |
| "log" | |
| "reflect" | |
| "unsafe" | |
| ) | |
| func main() { | |
| z := struct{ something string }{something: "..."} |
| /* --- generate html from json --- | |
| * ~ A lot of things are taken for granted here. ~ | |
| * - ajax has content-type hardcoded as json | |
| * - div have bootstrap container class and schema section key as id | |
| * - inputs have bootstrap form-control class | |
| * - each content is a separate div container | |
| * Limited custom behavior can be made by writing in custom | |
| */ | |
| var custom = ()=>{ | |
| document.getElementById("product").className=""; |
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "io" | |
| "log" | |
| "net" | |
| "os" | |
| "strings" |
| package main | |
| import ("fmt" | |
| "net/http") | |
| func server(){ | |
| http.HandleFunc("/",index_handler) | |
| http.HandleFunc("/links",links_handler) | |
| http.ListenAndServe("127.0.0.1:8000", nil) | |
| } |
| <?php | |
| /******************************************************************************** | |
| * Thin wrapper for basic I/O between scripts while still keeping them separate.* | |
| * Switch to AF_INET and provide the host address:port to fetch from network. * | |
| * <Github/WolvenSpirit> * | |
| ********************************************************************************/ | |
| // # work in progress # | |
| class AF_UNIX_WrapperC | |
| { |
| <?php | |
| namespace Application\Source; | |
| # The public index will require this file first, | |
| /* | |
| * ROUTER FILE | |
| */ | |
| class RouterClass | |
| { | |
| public static function init() |