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 :

  • htcolog ( colorful console logger )
  • htenvier ( ENV methods )

htcolog

example :

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

htenvier

example :

htenvier.ENV("DB_NAME")

Format & Validation

Format email , username and ...

example :

gommon.MakeMaskEmailAndDomain("[email protected]")    // output : use***@gm**.com
gommon.MakeMaskEmail("[email protected]")             // output : use***@gmail.com
gommon.MakeMaskUsername("myusername")                   // output : my***me
gommon.IsEmail("[email protected]")