Skip to content

Commit

Permalink
version and banner as global constant edoardottt#113
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardottt committed Mar 22, 2023
1 parent 5004687 commit 0beccfb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
4 changes: 3 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ linters-settings:
issues:
exclude-rules:
- path: crawler/colly.go
text: "should replace loop with `(FinalInfos|FinalErrors|FinalSecrets)"
text: "should replace loop with `(FinalInfos|FinalErrors|FinalSecrets)"
- path: pkg/output/beautify.go
text: "should be written without leading space as"
28 changes: 16 additions & 12 deletions pkg/output/beautify.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,24 @@ import (
"github.com/fatih/color"
)

// nolint: checknoglobals
const (
version = "v1.3.1-dev"
banner = ` _ _ _ _
(_) | | | (_)
___ __ _ _ __ _ __| | __| |_
/ __/ _` + "`" + ` | '__| |/ _` + "`" + ` |/ _` + "`" + ` | |
| (_| (_| | | | | (_| | (_| | |
\___\__,_|_| |_|\__,_|\__,_|_| `
)

// Beautify prints the banner + version.
func Beautify() {
banner1 := " _ _ _ _ \n"
banner2 := " ___ __ _ _ __(_) __| | __| (_)\n"
banner3 := " / __/ _` | '__| |/ _` |/ _` | |\n"
banner4 := " | (_| (_| | | | | (_| | (_| | |\n"
banner5 := " \\___\\__,_|_| |_|\\__,_|\\__,_|_| v1.3.0\n"
banner6 := "\n"
banner7 := " > github.com/edoardottt/cariddi\n"
banner8 := " > edoardoottavianelli.it\n"
banner9 := "========================================\n"

bannerPart1 := banner1 + banner2 + banner3 + banner4 + banner5
bannerPart2 := banner6 + banner7 + banner8 + banner9
links := " > github.com/edoardottt/cariddi\n > edoardoottavianelli.it\n"
sepLine := "========================================\n"

bannerPart1 := banner + version + "\n\n"
bannerPart2 := links + sepLine

color.Set(color.FgCyan)
fmt.Fprint(os.Stderr, bannerPart1)
Expand Down

0 comments on commit 0beccfb

Please sign in to comment.