Skip to content

Commit 90c442f

Browse files
Merge pull request #20 from spiegel-im-spiegel/fix-bugs-and-testing
Bump up version of external package
2 parents 9932d5e + 758e08b commit 90c442f

File tree

8 files changed

+37
-28
lines changed

8 files changed

+37
-28
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,13 @@ jobs:
3636
# a pull request then we can checkout the head.
3737
fetch-depth: 2
3838

39-
# If this run was triggered by a pull request event, then checkout
40-
# the head of the pull request instead of the merge commit.
41-
- run: git checkout HEAD^2
42-
if: ${{ github.event_name == 'pull_request' }}
43-
4439
# Initializes the CodeQL tools for scanning.
4540
- name: Initialize CodeQL
4641
uses: github/codeql-action/init@v1
4742
with:
4843
languages: ${{ matrix.language }}
4944
# If you wish to specify custom queries, you can do so here or in a config file.
50-
# By default, queries listed here will override any specified in a config file.
45+
# By default, queries listed here will override any specified in a config file.
5146
# Prefix the list here with "+" to use these queries and those in the config file.
5247
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5348

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414
# Other files and Folders
1515
*.bak
1616
work/
17+
.task/

Taskfile.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: '3'
2+
3+
tasks:
4+
default:
5+
cmds:
6+
- task: clean
7+
- task: test
8+
9+
test:
10+
desc: Test and lint.
11+
cmds:
12+
- go mod verify
13+
- go test ./...
14+
- docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.41.1 golangci-lint run --enable gosec --timeout 3m0s ./...
15+
sources:
16+
- ./go.mod
17+
- '**/*.go'
18+
19+
clean:
20+
desc: Initialize module and build cache, and remake go.sum file.
21+
cmds:
22+
- go mod tidy -v

clean-all.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ module github.com/spiegel-im-spiegel/pa-api
33
go 1.16
44

55
require (
6-
github.com/spiegel-im-spiegel/errs v1.0.2
7-
github.com/spiegel-im-spiegel/fetch v0.2.3
6+
github.com/spiegel-im-spiegel/errs v1.0.4
7+
github.com/spiegel-im-spiegel/fetch v0.2.4
88
)

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
github.com/spiegel-im-spiegel/errs v1.0.2 h1:v4amEwRDqRWjKHOILQnJSovYhZ4ZttEnBBXNXEzS6Sc=
2-
github.com/spiegel-im-spiegel/errs v1.0.2/go.mod h1:UoasJYYujMcdkbT9USv8dfZWoMyaY3btqQxoLJImw0A=
3-
github.com/spiegel-im-spiegel/fetch v0.2.3 h1:Zh5rHvOjfC81rxKvtUD21JT609smds+BRh+H84s8qEw=
4-
github.com/spiegel-im-spiegel/fetch v0.2.3/go.mod h1:ePIXxdC9OvSarXEO6HW1MgQwtBaKQo0qgDLOhKFXkQ0=
1+
github.com/spiegel-im-spiegel/errs v1.0.4 h1:87I8cOWD6g+7PhxPkET0tODPNIVk23ysxw+3yPCKGZY=
2+
github.com/spiegel-im-spiegel/errs v1.0.4/go.mod h1:dnsj80s7gRuzjtTxIE5oXZb2RGOyKPG3s+duTK1NkQs=
3+
github.com/spiegel-im-spiegel/fetch v0.2.4 h1:myxLKH+o8m/8EqF5656juc4hPtCu/W6HcTvEeBtdDGg=
4+
github.com/spiegel-im-spiegel/fetch v0.2.4/go.mod h1:WnG95BpB4f6z7+q9us7ro1+RzFX4XTk8yChIJpZ/u18=

marketplace.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package paapi5
22

3+
// Marketplace is interface class of locale information.
34
type Marketplace interface {
45
String() string
56
HostName() string
67
Region() string
78
Language() string
89
}
910

10-
// MarketplaceEnum is enumeration of locale information
11+
// MarketplaceEnum is enumeration of locale information.
1112
type MarketplaceEnum int
1213

1314
const (
@@ -117,7 +118,7 @@ var languageMap = map[MarketplaceEnum]string{
117118
LocaleUnitedStates: "en_US", //United States
118119
}
119120

120-
//MarketplaceOf function returns Marketplace instance from service domain
121+
// MarketplaceOf function returns Marketplace instance from service domain.
121122
func MarketplaceOf(s string) Marketplace {
122123
for k, v := range marketplaceMap {
123124
if s == v {
@@ -127,31 +128,31 @@ func MarketplaceOf(s string) Marketplace {
127128
return LocaleUnknown
128129
}
129130

130-
//String returns marketplace name of Marketplace
131+
// String returns marketplace name of Marketplace.
131132
func (m MarketplaceEnum) String() string {
132133
if s, ok := marketplaceMap[m]; ok {
133134
return s
134135
}
135136
return marketplaceMap[DefaultMarketplace]
136137
}
137138

138-
//HostName returns hostname of Marketplace
139+
// HostName returns hostname of Marketplace.
139140
func (m MarketplaceEnum) HostName() string {
140141
if s, ok := hostMap[m]; ok {
141142
return s
142143
}
143144
return hostMap[LocaleUnitedStates]
144145
}
145146

146-
//Region returns region name of Marketplace
147+
// Region returns region name of Marketplace.
147148
func (m MarketplaceEnum) Region() string {
148149
if s, ok := regionMap[m]; ok {
149150
return s
150151
}
151152
return regionMap[DefaultMarketplace]
152153
}
153154

154-
//Language returns region name of Marketplace
155+
// Language returns language name of Marketplace.
155156
func (m MarketplaceEnum) Language() string {
156157
if s, ok := languageMap[m]; ok {
157158
return s

test-all.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)