Skip to content
/ chs Public

small method to replace if-default-value code in code

Notifications You must be signed in to change notification settings

yqylovy/chs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

chs

help to replace judging-code in golang

change

    if a == 0 {
        a = defaultValue
    }
    if s == "" {
        s = defaultStr
    }

to

    a = IntOrDefault(a,defaultValue)
    s = StrOrDefault(s,defaultStr)

About

small method to replace if-default-value code in code

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages