Help us shape the future of Go! Take the 2026 Go Developer Survey

dailyhelper

package module
v0.0.0-...-311482e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2019 License: GPL-3.0 Imports: 8 Imported by: 4

README

dailyhelper

A set of functions used in the daily life of a go programmer.

How to user

installation

get the library

go get github.com/shouva/dailyhelper

using

// import
import helper "github.com/shouva/dailyhelper"
...

//getcurrent dir
currentdir := helper.GetCurrentPath()

//get config

//create struct
struct Setting {
    Name string `json:"name"`
    Nomor uint16 `json:"nomor"`
}

//read the config
var setting Setting
err :=helper.ReadConfig(currentdir + "/config.json", &setting)

fmt.Println(setting.Name)

Sponsorship

This repository is sponsored by Shouva Store and Otoritech.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeautySingularity

func BeautySingularity(id string) string

BeautySingularity : converting NameId or Nameid to nameID etc

func GetCurrentPath

func GetCurrentPath(isbuild bool) string

GetCurrentPath :

func IsCountable

func IsCountable(plural string) bool

IsCountable :

func IsValidImage

func IsValidImage(file multipart.File) bool

IsValidImage :

func ReadConfig

func ReadConfig(path string, config interface{}) error

ReadConfig :

func Singular

func Singular(plural string) string

Singular : convert plural string to singular string this helper copypaste from : https://www.socketloop.com/tutorials/golang-takes-a-plural-word-and-makes-it-singular License

func SnakeCaseToCamelCase

func SnakeCaseToCamelCase(inputUnderScoreStr string, firstUpperCase bool) (camelCase string)

SnakeCaseToCamelCase :

func Struct2Map

func Struct2Map(in interface{}) (out map[string]interface{}, err error)

Struct2Map :

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL