Skip to content

hamidteimouri/gommon

Repository files navigation

Gommon (Golang Common)

Gommon is a golang common package that provides several methods to use in your projects.
Gommon has several sub-package :

  • htblockchain
  • htcolog ( colorful console logger )
  • htenvier ( ENV methods )
  • htregex ( work with regex )

htcolog

example :

htcolog.DoGreen("prints a green string")
htcolog.MakeRed("returns a red string")

htenvier

example :

htenvier.ENV("DB_NAME")

Format

Format email , username and ...

example :

gommon.MakeMaskEmailAndDomain("usernaame@gmail.com")    // output : use***@gm**.com
gommon.MakeMaskEmail("usernaame@gmail.com")             // output : use***@gmail.com
gommon.MakeMaskUsername("myusername")                   // output : my***me

htregex

example :

htregex.IsEmail("username@gmail.com")