-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from arteev/feature/REFACTOR-1
Feature/refactor 1
- Loading branch information
Showing
10 changed files
with
249 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,6 @@ _testmain.go | |
|
||
.idea/* | ||
*.out | ||
*.test.* | ||
*.test.* | ||
|
||
.vscode |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/arteev/fmttab" | ||
) | ||
|
||
func main() { | ||
BORDER_MY := fmttab.Border(100) | ||
fmttab.Borders[BORDER_MY] = map[fmttab.BorderKind]string{ | ||
borderMy := fmttab.Border(100) | ||
fmttab.Borders[borderMy] = map[fmttab.BorderKind]string{ | ||
|
||
fmttab.BKVertical: "|", | ||
fmttab.BKHorizontal : "-", | ||
fmttab.BKHorizontalBorder : "_", | ||
fmttab.BKVertical: "|", | ||
fmttab.BKHorizontal: "-", | ||
fmttab.BKHorizontalBorder: "_", | ||
} | ||
tab := fmttab.New("Custom table:",BORDER_MY,nil) | ||
tab.AddColumn("Key",15,fmttab.AlignLeft). | ||
AddColumn("Value",15,fmttab.AlignRight) | ||
tab := fmttab.New("Custom table:", borderMy, nil) | ||
tab.AddColumn("Key", 15, fmttab.AlignLeft). | ||
AddColumn("Value", 15, fmttab.AlignRight) | ||
tab.Data = []map[string]interface{}{ | ||
{ | ||
"Key":"Key One", | ||
"Key": "Key One", | ||
"Value": "Value One", | ||
}, | ||
{ | ||
"Key":"Key Two", | ||
"Key": "Key Two", | ||
"Value": "Value Two", | ||
}, | ||
} | ||
tab.WriteTo(os.Stdout) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
"strings" | ||
|
||
"github.com/arteev/fmttab" | ||
"github.com/arteev/fmttab/columns" | ||
) | ||
|
||
func main() { | ||
tab := fmttab.New("Environments:",fmttab.BorderNone,nil) | ||
tab.Columns = []*fmttab.Column{ | ||
{ | ||
Name:"ENV",Width:25,Aling:fmttab.AlignLeft, | ||
}, | ||
{ | ||
Name:"VALUE",Width:25,Aling:fmttab.AlignLeft, | ||
}, | ||
} | ||
for _,env:=range os.Environ() { | ||
keyval := strings.Split(env,"=") | ||
tab.Data = append(tab.Data,map[string]interface{} { | ||
"ENV": keyval[0], | ||
"VALUE" : keyval[1], | ||
tab := fmttab.New("Environments:", fmttab.BorderNone, nil) | ||
tab.AddColumn("ENV", 25, fmttab.AlignLeft) | ||
tab.Columns.Add(&columns.Column{ | ||
Name: "VALUE", Width: 25, Aling: fmttab.AlignLeft, Visible: true, | ||
}) | ||
|
||
for _, env := range os.Environ() { | ||
keyval := strings.Split(env, "=") | ||
tab.Data = append(tab.Data, map[string]interface{}{ | ||
"ENV": keyval[0], | ||
"VALUE": keyval[1], | ||
}) | ||
} | ||
tab.WriteTo(os.Stdout) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.