Skip to content

Commit 2122339

Browse files
authored
Merge pull request #401 from devlights/mv-mappings-directory
Rename mappings to mapping
2 parents aaba3ba + 6a276fc commit 2122339

File tree

66 files changed

+251
-349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+251
-349
lines changed

builder/builder.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import (
55
"github.com/devlights/try-golang/examples/basic"
66
"github.com/devlights/try-golang/examples/effectivego"
77
"github.com/devlights/try-golang/examples/gotour"
8-
"github.com/devlights/try-golang/mappings"
8+
"github.com/devlights/try-golang/mapping"
99
)
1010

1111
// BuildMappings は、サンプル実行のためのマッピング情報を構築します.
12-
func BuildMappings() mappings.ExampleMapping {
13-
m := mappings.NewSampleMapping()
12+
func BuildMappings() mapping.ExampleMapping {
13+
m := mapping.NewSampleMapping()
1414

1515
m.MakeMapping(
1616
advanced.NewRegister(),

cmd/trygolang/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import (
1010
"github.com/devlights/gomy/strops"
1111
"github.com/devlights/try-golang/builder"
1212
"github.com/devlights/try-golang/command"
13-
"github.com/devlights/try-golang/mappings"
13+
"github.com/devlights/try-golang/mapping"
1414
)
1515

1616
func main() {
1717
var (
1818
args *Args
19-
mapping mappings.ExampleMapping
19+
mapping mapping.ExampleMapping
2020
)
2121

2222
appLog, errLog, _ := logops.Default.Logger(true, func(_, e, _ *log.Logger) {

command/errs.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ package command
33
import (
44
"fmt"
55

6-
"github.com/devlights/try-golang/mappings"
6+
"github.com/devlights/try-golang/mapping"
77
)
88

99
type (
1010
// ExecError -- 実行時エラーを表します.
1111
ExecError struct {
12-
Name mappings.ExampleKey // 名称
13-
Err error // エラー
12+
Name mapping.ExampleKey // 名称
13+
Err error // エラー
1414
}
1515
)
1616

command/exec.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"time"
66

7-
"github.com/devlights/try-golang/mappings"
7+
"github.com/devlights/try-golang/mapping"
88
)
99

1010
type (
@@ -15,16 +15,16 @@ type (
1515

1616
// ExecArgs -- ExecCommand の 引数データ を表します.
1717
ExecArgs struct {
18-
Target string // 対象
19-
Mapping mappings.ExampleMapping // マッピング情報
18+
Target string // 対象
19+
Mapping mapping.ExampleMapping // マッピング情報
2020
}
2121
)
2222

2323
// NewExecArgs -- 新しい ExecArgs を生成して返します.
24-
func NewExecArgs(target string, mapping mappings.ExampleMapping) *ExecArgs {
24+
func NewExecArgs(target string, m mapping.ExampleMapping) *ExecArgs {
2525
a := new(ExecArgs)
2626
a.Target = target
27-
a.Mapping = mapping
27+
a.Mapping = m
2828
return a
2929
}
3030

@@ -38,7 +38,7 @@ func NewExecCommand(args *ExecArgs) *ExecCommand {
3838
// Run -- 実行します.
3939
func (c *ExecCommand) Run() error {
4040
var (
41-
target = mappings.ExampleKey(c.Args.Target)
41+
target = mapping.ExampleKey(c.Args.Target)
4242
mapping = c.Args.Mapping
4343
)
4444

command/runloop.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"sort"
88
"strings"
99

10-
"github.com/devlights/try-golang/mappings"
10+
"github.com/devlights/try-golang/mapping"
1111
)
1212

1313
type (
@@ -18,16 +18,16 @@ type (
1818

1919
// RunLoopArgs -- RunLoopCommand の引数データを表します.
2020
RunLoopArgs struct {
21-
OneTime bool // 一回実行で完了するかどうか
22-
Mapping mappings.ExampleMapping // マッピング情報
21+
OneTime bool // 一回実行で完了するかどうか
22+
Mapping mapping.ExampleMapping // マッピング情報
2323
}
2424
)
2525

2626
// NewRunLoopArgs -- 新しい RunLoopArgs を生成して返します.
27-
func NewRunLoopArgs(oneTime bool, mapping mappings.ExampleMapping) *RunLoopArgs {
27+
func NewRunLoopArgs(oneTime bool, m mapping.ExampleMapping) *RunLoopArgs {
2828
a := new(RunLoopArgs)
2929
a.OneTime = oneTime
30-
a.Mapping = mapping
30+
a.Mapping = m
3131
return a
3232
}
3333

@@ -116,7 +116,7 @@ func (c *RunLoopCommand) Run() error {
116116
return nil
117117
}
118118

119-
func (c *RunLoopCommand) exec(target string, mapping mappings.ExampleMapping) error {
119+
func (c *RunLoopCommand) exec(target string, mapping mapping.ExampleMapping) error {
120120
execArgs := NewExecArgs(target, mapping)
121121
execCmd := NewExecCommand(execArgs)
122122

@@ -127,7 +127,7 @@ func (c *RunLoopCommand) exec(target string, mapping mappings.ExampleMapping) er
127127
return nil
128128
}
129129

130-
func (c *RunLoopCommand) makeCandidates(userInput string, mapping mappings.ExampleMapping) []string {
130+
func (c *RunLoopCommand) makeCandidates(userInput string, mapping mapping.ExampleMapping) []string {
131131
candidates := make([]string, 0, len(mapping))
132132
for k := range mapping {
133133
key := string(k)

command/runonce.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package command
22

3-
import (
4-
"github.com/devlights/try-golang/mappings"
5-
)
3+
import "github.com/devlights/try-golang/mapping"
64

75
type (
86
// RunOnceCommand -- 一度だけ実行するコマンド
@@ -17,10 +15,10 @@ type (
1715
)
1816

1917
// NewRunOnceArgs -- 新しい RunOnceArgs を生成して返します.
20-
func NewRunOnceArgs(target string, mapping mappings.ExampleMapping) *RunOnceArgs {
18+
func NewRunOnceArgs(target string, m mapping.ExampleMapping) *RunOnceArgs {
2119
a := new(RunOnceArgs)
2220
a.Target = target
23-
a.Mapping = mapping
21+
a.Mapping = m
2422
return a
2523
}
2624

examples/advanced/async/examples.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ import (
44
"github.com/devlights/try-golang/examples/advanced/async/concat"
55
"github.com/devlights/try-golang/examples/advanced/async/fanin"
66
"github.com/devlights/try-golang/examples/advanced/async/ordone"
7-
"github.com/devlights/try-golang/mappings"
7+
"github.com/devlights/try-golang/mapping"
88
)
99

1010
type (
1111
register struct{}
1212
)
1313

14-
// NewRegister -- このパッケージ用のサンプルを登録する mappings.Register を生成します。
15-
func NewRegister() mappings.Register {
14+
// NewRegister -- このパッケージ用のサンプルを登録する mapping.Register を生成します。
15+
func NewRegister() mapping.Register {
1616
r := new(register)
1717
return r
1818
}
1919

2020
// Regist -- サンプルを登録します。
21-
func (r *register) Regist(m mappings.ExampleMapping) {
21+
func (r *register) Regist(m mapping.ExampleMapping) {
2222
m["async01"] = Async01
2323
m["async_producer_consumer"] = ProducerConsumer
2424
m["async_dir_walk_recursive"] = DirWalkRecursive
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
package closure
22

3-
import (
4-
"github.com/devlights/try-golang/mappings"
5-
)
3+
import "github.com/devlights/try-golang/mapping"
64

75
type (
86
register struct{}
97
)
108

11-
// NewRegister -- このパッケージ用のサンプルを登録する mappings.Register を生成します。
12-
func NewRegister() mappings.Register {
9+
// NewRegister -- このパッケージ用のサンプルを登録する mapping.Register を生成します。
10+
func NewRegister() mapping.Register {
1311
r := new(register)
1412
return r
1513
}
1614

1715
// Regist -- サンプルを登録します。
18-
func (r *register) Regist(m mappings.ExampleMapping) {
16+
func (r *register) Regist(m mapping.ExampleMapping) {
1917
m["closure01"] = Closure01
2018
}
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
package crypto
22

3-
import (
4-
"github.com/devlights/try-golang/mappings"
5-
)
3+
import "github.com/devlights/try-golang/mapping"
64

75
type (
86
register struct{}
97
)
108

11-
// NewRegister -- このパッケージ用のサンプルを登録する mappings.Register を生成します。
12-
func NewRegister() mappings.Register {
9+
// NewRegister -- このパッケージ用のサンプルを登録する mapping.Register を生成します。
10+
func NewRegister() mapping.Register {
1311
r := new(register)
1412
return r
1513
}
1614

1715
// Regist -- サンプルを登録します。
18-
func (r *register) Regist(m mappings.ExampleMapping) {
16+
func (r *register) Regist(m mapping.ExampleMapping) {
1917
m["crypto_bcrypt_password_hash"] = BcryptPasswordHash
2018
}
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
package deepcopy
22

3-
import (
4-
"github.com/devlights/try-golang/mappings"
5-
)
3+
import "github.com/devlights/try-golang/mapping"
64

75
type (
86
register struct{}
97
)
108

11-
// NewRegister -- このパッケージ用のサンプルを登録する mappings.Register を生成します。
12-
func NewRegister() mappings.Register {
9+
// NewRegister -- このパッケージ用のサンプルを登録する mapping.Register を生成します。
10+
func NewRegister() mapping.Register {
1311
return &register{}
1412
}
1513

1614
// Regist -- サンプルを登録します。
17-
func (r *register) Regist(m mappings.ExampleMapping) {
15+
func (r *register) Regist(m mapping.ExampleMapping) {
1816
m["deepcopy_gob"] = GobDeepCopy
1917
m["deepcopy_json"] = JsonDeepCopy
2018
}

0 commit comments

Comments
 (0)