Skip to content

Commit

Permalink
IMPROVEMENT-12: Refactor and add documentation to utils package
Browse files Browse the repository at this point in the history
  • Loading branch information
grafviktor committed Nov 19, 2023
1 parent 8124648 commit 8549f44
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import (
"github.com/grafviktor/goto/internal/constant"
)

type Logger interface {
Debug(format string, args ...any)
}

// stringEmpty - checks if string is empty or contains only spaces.
// s is string to check.
func stringEmpty(s string) bool {
return len(strings.TrimSpace(s)) == 0
}

// CreateAppDirIfNotExists - creates application home folder if it doesn't exist.
// appConfigDir is application home folder path.
func CreateAppDirIfNotExists(appConfigDir string) error {
if stringEmpty(appConfigDir) {
return constant.ErrBadArgument
Expand Down

0 comments on commit 8549f44

Please sign in to comment.