Categorygithub.com/ssst0n3/awesome_libs
repositorypackage
0.6.7
Repository: https://github.com/ssst0n3/awesome_libs.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

awesome libs

  • cipher
  • error: print and trace
  • reflect: some useful reflect gadgets
  • slice
    • func In(item interface{}, slice interface{}) bool
  • python like format

error

use awesome_libs/log.Logger as Logger

import "github.com/ssst0n3/awesome_libs/awesome_error"

func example()  {
    awesome_error.CheckError(errors.New("test"))
}

use self-defined logger

import (
	"errors"
	"github.com/ssst0n3/awesome_libs/log/logger"
	"os"
)

func example() {
	a := GetAwesomeError(logger.InitLogger("my-logger", os.Stdout))
	a.CheckErr(errors.New("apple"))
}

cipher

There's a CommonCipher already inited for you. It's key read from SecretDir/awesome_libs_cipher_common.

import "github.com/ssst0n3/awesome_libs/cipher"

func any()  {
    ...
    enc, err := cipher.CommonCipher.Encrypt(pt)
}

python like format

import "github.com/ssst0n3/awesome_libs"

func Format()  {
	awesome_libs.Format("Hello {.name}", awesome_libs.Dict{
		"name": "awesome",
	})
}