Skip to content

Commit d109d73

Browse files
committed
chore: apply lint
1 parent 8dc1c46 commit d109d73

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

main.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
"time"
1212
)
1313

14-
const ShellToUse = "bash"
15-
const AppVersion = "v1.2.2"
14+
const shellToUse = "bash"
15+
const appVersion = "v1.2.2"
1616

1717
var (
1818
gitBaseCommand = "git"
@@ -22,7 +22,7 @@ var (
2222
logFileFolder = "release-logs"
2323
releaseFileName = "release-log.md"
2424
isCommitLog = false
25-
gitRemoteUrl, gitRemoteName, projectPath, outputPath string
25+
gitRemoteURL, gitRemoteName, projectPath, outputPath string
2626
haveBreakChange = false
2727
haveLog = false
2828
writeNewFile = new(bool)
@@ -100,7 +100,7 @@ func parseCliOptions() {
100100

101101
func printVersionInfo() {
102102
fmt.Println("-: Awesome Release Logger(ARL) :-")
103-
fmt.Printf("Version: %s\n", AppVersion)
103+
fmt.Printf("Version: %s\n", appVersion)
104104
fmt.Println("Copyright(c) 2020 TheDevsTech - GPL-3.0")
105105
os.Exit(0)
106106
}
@@ -115,7 +115,7 @@ func directoryOrFileExists(path string) bool {
115115
func shellout(command string) (string, error, string) {
116116
var stdout bytes.Buffer
117117
var stderr bytes.Buffer
118-
cmd := exec.Command(ShellToUse, "-c", command)
118+
cmd := exec.Command(shellToUse, "-c", command)
119119
cmd.Stdout = &stdout
120120
cmd.Stderr = &stderr
121121
err := cmd.Run()
@@ -137,39 +137,39 @@ func findGitRemote() {
137137
}
138138

139139
if len(remoteList) > 1 {
140-
gitRemoteUrl, gitRemoteName = getRemoteFromUserInput(remoteList)
140+
gitRemoteURL, gitRemoteName = getRemoteFromUserInput(remoteList)
141141

142142
} else {
143143
for name, url := range remoteList {
144-
gitRemoteUrl = url
144+
gitRemoteURL = url
145145
gitRemoteName = name
146146
break
147147
}
148148
}
149149

150150
//replace ssh clone url to https
151-
if len(gitRemoteUrl) > 0 {
152-
if strings.HasPrefix(gitRemoteUrl, "git@") {
153-
gitRemoteUrl = replaceMessage(gitRemoteUrl, ":", "/")
154-
gitRemoteUrl = replaceMessage(gitRemoteUrl, "git@", "https://")
151+
if len(gitRemoteURL) > 0 {
152+
if strings.HasPrefix(gitRemoteURL, "git@") {
153+
gitRemoteURL = replaceMessage(gitRemoteURL, ":", "/")
154+
gitRemoteURL = replaceMessage(gitRemoteURL, "git@", "https://")
155155
}
156156
}
157157
}
158158
}
159159

160160
func getRemoteFromUserInput(remoteList map[string]string) (string, string) {
161-
remoteUrl := ""
161+
remoteURL := ""
162162
remoteName := ""
163163
for {
164164
choosenName := getUserChoice(remoteList)
165165
url, exists := remoteList[choosenName]
166166
if exists {
167-
remoteUrl = url
167+
remoteURL = url
168168
remoteName = choosenName
169169
break
170170
}
171171
}
172-
return remoteUrl, remoteName
172+
return remoteURL, remoteName
173173
}
174174

175175
func getUserChoice(remoteList map[string]string) string {
@@ -252,13 +252,13 @@ func replaceMessage(message string, search string, replace string) string {
252252

253253
func formatMessage(message string, sha string, shortSha string) string {
254254
messageSlice := []string{}
255-
if len(gitRemoteUrl) > 0 {
255+
if len(gitRemoteURL) > 0 {
256256
messageSlice = []string{message,
257257
" ",
258258
"([",
259259
shortSha,
260260
"](",
261-
gitRemoteUrl,
261+
gitRemoteURL,
262262
"/commit/",
263263
sha,
264264
"))",
@@ -417,7 +417,7 @@ func writeReleaseLog() {
417417
//now write diff between two tags
418418
if len(latestTag) > 0 {
419419
writeLine(nf, "## Diff")
420-
diffText := fmt.Sprintf("* %s/compare/%s...%s", gitRemoteUrl, latestTag, newTag)
420+
diffText := fmt.Sprintf("* %s/compare/%s...%s", gitRemoteURL, latestTag, newTag)
421421
writeLine(nf, diffText)
422422
}
423423

@@ -462,7 +462,7 @@ func commitLog() {
462462

463463
func pushHeadAndTagToRemote() {
464464
//if has remote then push it
465-
if len(gitRemoteUrl) > 0 {
465+
if len(gitRemoteURL) > 0 {
466466
fmt.Println("Pushing HEAD & tag to remote...")
467467
pushBaseCmd := fmt.Sprintf("%s push %s", gitBaseCommand, gitRemoteName)
468468
pushCommitTagCmd := fmt.Sprintf("%s HEAD && %s %s", pushBaseCmd, pushBaseCmd, newTag)

0 commit comments

Comments
 (0)