Skip to content

ssst0n3/awesome_libs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

dc207ec · Jan 4, 2022

History

73 Commits
Sep 9, 2020
Jan 4, 2022
Dec 22, 2021
Jan 11, 2021
Oct 26, 2020
Dec 26, 2020
Aug 26, 2021
Sep 30, 2020
Dec 7, 2021
Sep 21, 2020
Sep 14, 2020
Dec 26, 2020
Jun 19, 2020
Jun 17, 2020
Aug 26, 2021
Sep 30, 2020
Jan 4, 2022
Sep 30, 2020
Sep 1, 2021
Sep 30, 2020
Mar 11, 2021
Mar 11, 2021
Jan 20, 2021
Jan 20, 2021
Jun 18, 2020

Repository files navigation

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), true)
	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",
	})
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published