Skip to content

Commit

Permalink
Chores
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyaren committed Feb 20, 2024
1 parent b1e545f commit b2d8637
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20' # The Go version to download (if necessary) and use.
go-version-file: 'go.mod'
- uses: actions/cache@v4
with:
# In order:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20' # The Go version to download (if necessary) and use.
go-version-file: 'go.mod'
- uses: actions/cache@v4
with:
# In order:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20' # The Go version to download (if necessary) and use.
go-version-file: 'go.mod'
- uses: actions/cache@v4
with:
# In order:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.19' # The Go version to download (if necessary) and use.
go-version-file: 'go.mod'
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
Expand Down
24 changes: 14 additions & 10 deletions cmd/arcdps-log-uploader/ui/textgenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,19 @@ func generateMessageTextDiscord(entries []*model.ArcLog, formatOptions FormatOpt

for _, entry := range result {
output := ""
const tick = "`"
const space = " "
if len(dates) > 1 {
output += "`" + entry.encounterTime.Format("02.01.2006") + "`"
output += " "
output += tick + entry.encounterTime.Format("02.01.2006") + tick
output += space
}
output += "`" + entry.encounterTime.Format("15:04") + "`"
output += " "
output += tick + entry.encounterTime.Format("15:04") + tick
output += space

if formatOptions.IncludeDuration {
out := time.Time{}.Add(time.Duration(entry.arcLog.Report.Encounter.Duration) * time.Second)
output += "`" + out.Format("04m 05s") + "`"
output += " "
output += tick + out.Format("04m 05s") + tick
output += space
}

output += "<"
Expand All @@ -73,10 +75,11 @@ func generateMessageTextDiscord(entries []*model.ArcLog, formatOptions FormatOpt
var messages []string
var currentMessage = ""
for _, line := range lines {
var currentMessagePlusThisLine = currentMessage + "\r\n" + line
const linebreak = "\r\n"
var currentMessagePlusThisLine = currentMessage + linebreak + line
if len(currentMessagePlusThisLine) > (2000 - len(headline) - 10) {
messages = append(messages, currentMessage)
currentMessage = "\r\n" + line
currentMessage = linebreak + line
} else {
currentMessage = currentMessagePlusThisLine
}
Expand Down Expand Up @@ -147,10 +150,11 @@ func generateMessageTextTeamspeak(entries []*model.ArcLog, formatOptions FormatO
var messages []string
var currentMessage = ""
for _, line := range lines {
var currentMessagePlusThisLine = currentMessage + "\r\n" + line
const linebreak = "\r\n"
var currentMessagePlusThisLine = currentMessage + linebreak + line
if len(currentMessagePlusThisLine) > (10000 - len(headline) - 10) {
messages = append(messages, currentMessage)
currentMessage = "\r\n" + line
currentMessage = linebreak + line
} else {
currentMessage = currentMessagePlusThisLine
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/xyaren/arcdps-log-uploader

go 1.20
go 1.22

require (
github.com/blang/semver/v4 v4.0.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-github/v30 v30.1.0 h1:VLDx+UolQICEOKu2m4uAoMti1SxuEBAl7RSEG16L+Oo=
github.com/google/go-github/v30 v30.1.0/go.mod h1:n8jBpHl45a/rlBUtRJMOG4GhNADUQFEufcolZ95JfU8=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
Expand Down Expand Up @@ -80,6 +81,7 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
1 change: 0 additions & 1 deletion revive.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ warningCode = 0
[rule.increment-decrement]
[rule.var-naming]
[rule.var-declaration]
[rule.package-comments]
[rule.range]
[rule.receiver-naming]
[rule.time-naming]
Expand Down

0 comments on commit b2d8637

Please sign in to comment.