Skip to content

Instantly share code, notes, and snippets.

@ecoshub
ecoshub / funcInfo.go
Last active July 16, 2023 00:10
get function info including comment / doc section
package main
import (
"errors"
"fmt"
"go/ast"
"go/doc"
"go/parser"
"go/token"
"path/filepath"
@ecoshub
ecoshub / intToByteArrayAsString.go
Created February 12, 2020 23:57
golang into to byte array (as string formation)
package main
import "fmt"
func main(){
number := 514235
fmt.Println("original number\t\t\t\t", number)
numArr := IntToByteArray(number)
fmt.Println("number as byte array\t\t", numArr)
@ecoshub
ecoshub / IntToByteArray.go
Last active May 9, 2024 06:17
golang integer to byte array and byte array to integer function
package main
import (
"fmt"
"unsafe"
)
func main(){
// integer for convert
num := int64(1354321354812)