Skip to content

Commit

Permalink
Merge pull request #35 from woodpecker-kit/34-feature-wd_info_shot-name
Browse files Browse the repository at this point in the history
feat(go): rename wd_info_shot -> wd_short_info
  • Loading branch information
sinlov authored Mar 16, 2024
2 parents b26f356 + 11210f0 commit 6827e6e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ $ echo "go mod vendor"
string
- [x] `wd_template` for support Handlebars.js for golang
- use `wd_template.RegisterSettings(DefaultFunctions)` once to register default functions then use
- [x] `wd_info_shot.ParseWoodpeckerInfo2Shot` can parse `wd_info.WoodpeckerInfo` to `wd_info_shot.WoodpeckerInfoShot`
- [x] `wd_short_info.ParseWoodpeckerInfo2Short` can parse `wd_info.WoodpeckerInfo` to `wd_short_info.WoodpeckerInfoShot` (v1.18+)
for template more clear
- [x] code check
- [x] full check by golang version
Expand Down
10 changes: 5 additions & 5 deletions wd_mock_test/wd_info_short_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package wd_mock_test
import (
"github.com/sebdah/goldie/v2"
"github.com/woodpecker-kit/woodpecker-tools/wd_info"
"github.com/woodpecker-kit/woodpecker-tools/wd_info_shot"
"github.com/woodpecker-kit/woodpecker-tools/wd_mock"
"github.com/woodpecker-kit/woodpecker-tools/wd_short_info"
"testing"
)

func TestParseWoodpeckerInfo2Shot(t *testing.T) {
// mock ParseWoodpeckerInfo2Shot
// mock ParseWoodpeckerInfo2Short
type args struct {
info wd_info.WoodpeckerInfo
}
Expand Down Expand Up @@ -57,12 +57,12 @@ func TestParseWoodpeckerInfo2Shot(t *testing.T) {
goldie.WithDiffEngine(goldie.ClassicDiff),
)

// do ParseWoodpeckerInfo2Shot
gotResult := wd_info_shot.ParseWoodpeckerInfo2Shot(tc.args.info)
// do ParseWoodpeckerInfo2Short
gotResult := wd_short_info.ParseWoodpeckerInfo2Short(tc.args.info)
if tc.wantErr != nil {
return
}
// verify ParseWoodpeckerInfo2Shot
// verify ParseWoodpeckerInfo2Short
g.AssertJson(t, t.Name(), gotResult)
})
}
Expand Down
4 changes: 2 additions & 2 deletions wd_info_shot/shot_parse.go → wd_short_info/short_parse.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package wd_info_shot
package wd_short_info

import "github.com/woodpecker-kit/woodpecker-tools/wd_info"

func ParseWoodpeckerInfo2Shot(info wd_info.WoodpeckerInfo) WoodpeckerInfoShort {
func ParseWoodpeckerInfo2Short(info wd_info.WoodpeckerInfo) WoodpeckerInfoShort {
short := WoodpeckerInfoShort{
Repo: Repo{
Scm: info.RepositoryInfo.CIRepoScm,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wd_info_shot
package wd_short_info

import _ "github.com/woodpecker-kit/woodpecker-tools/wd_info"

Expand Down

0 comments on commit 6827e6e

Please sign in to comment.