Skip to content

Commit

Permalink
chore: flat package #4 (#8)
Browse files Browse the repository at this point in the history
* move code

* change package

* update gomod

* fix package

* remove vendor

* version up
  • Loading branch information
jiro4989 committed Nov 8, 2020
1 parent 4d15f72 commit 9a8eb2d
Show file tree
Hide file tree
Showing 113 changed files with 11 additions and 19,296 deletions.
2 changes: 1 addition & 1 deletion align/align.go → align.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package align
package main

import (
"strings"
Expand Down
2 changes: 1 addition & 1 deletion align/align_test.go → align_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package align
package main

import (
"testing"
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module github.com/jiro4989/align

go 1.14

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
Expand Down
5 changes: 2 additions & 3 deletions subcmd_center.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"os"
"strings"

"github.com/jiro4989/align/align"
"github.com/nsf/termbox-go"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -62,7 +61,7 @@ var centerCommand = &cobra.Command{
// 引数なしの場合は標準入力を処理
if len(args) < 1 {
args = readStdin()
padded := align.AlignCenter(args, n, p)
padded := AlignCenter(args, n, p)
for _, v := range padded {
fmt.Println(v)
}
Expand All @@ -76,7 +75,7 @@ var centerCommand = &cobra.Command{
}
s := string(b)
lines := strings.Split(s, lf)
padded := align.AlignCenter(lines, n, p)
padded := AlignCenter(lines, n, p)

// ファイル上書き指定があれば上書き
if writeFile {
Expand Down
5 changes: 2 additions & 3 deletions subcmd_left.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"os"
"strings"

"github.com/jiro4989/align/align"
"github.com/nsf/termbox-go"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -62,7 +61,7 @@ var leftCommand = &cobra.Command{
// 引数なしの場合は標準入力を処理
if len(args) < 1 {
args = readStdin()
padded := align.AlignLeft(args, n, p)
padded := AlignLeft(args, n, p)
for _, v := range padded {
fmt.Println(v)
}
Expand All @@ -76,7 +75,7 @@ var leftCommand = &cobra.Command{
}
s := string(b)
lines := strings.Split(s, lf)
padded := align.AlignLeft(lines, n, p)
padded := AlignLeft(lines, n, p)

// ファイル上書き指定があれば上書き
if writeFile {
Expand Down
5 changes: 2 additions & 3 deletions subcmd_right.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"os"
"strings"

"github.com/jiro4989/align/align"
"github.com/nsf/termbox-go"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -62,7 +61,7 @@ var rightCommand = &cobra.Command{
// 引数なしの場合は標準入力を処理
if len(args) < 1 {
args = readStdin()
padded := align.AlignRight(args, n, p)
padded := AlignRight(args, n, p)
for _, v := range padded {
fmt.Println(v)
}
Expand All @@ -76,7 +75,7 @@ var rightCommand = &cobra.Command{
}
s := string(b)
lines := strings.Split(s, lf)
padded := align.AlignRight(lines, n, p)
padded := AlignRight(lines, n, p)

// ファイル上書き指定があれば上書き
if writeFile {
Expand Down
15 changes: 0 additions & 15 deletions vendor/github.com/davecgh/go-spew/LICENSE

This file was deleted.

145 changes: 0 additions & 145 deletions vendor/github.com/davecgh/go-spew/spew/bypass.go

This file was deleted.

38 changes: 0 additions & 38 deletions vendor/github.com/davecgh/go-spew/spew/bypasssafe.go

This file was deleted.

Loading

0 comments on commit 9a8eb2d

Please sign in to comment.