Skip to content

Commit

Permalink
Update: new scripts)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssleert committed Feb 25, 2023
1 parent 83d4a86 commit 85d3937
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
zfxtop*
release/
5 changes: 5 additions & 0 deletions cmd/zfxtop/zfxtop.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ func main() {
msg.ExitMsg(err)
}

defer func() {
s.Stop()
os.Exit(0)
}()

d := data.Start()

datadyn := &s.DataDyn
Expand Down
42 changes: 21 additions & 21 deletions examples/goruTest.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ import "fmt"

func main() {

channel1 := make(chan int)
channel2 := make(chan int)
channel3 := make(chan int)
channel1 := make(chan int)
channel2 := make(chan int)
channel3 := make(chan int)

//First Way
var channels_first []chan int
channels_first = append(channels_first, channel1)
channels_first = append(channels_first, channel2)
channels_first = append(channels_first, channel3)
//First Way
var channels_first []chan int
channels_first = append(channels_first, channel1)
channels_first = append(channels_first, channel2)
channels_first = append(channels_first, channel3)

fmt.Println("\nOutput for First slice of channels")
for _, c := range channels_first {
fmt.Println(c)
}
fmt.Println("\nOutput for First slice of channels")
for _, c := range channels_first {
fmt.Println(c)
}

//Second Way
channels_second := make([]chan int, 3)
channels_second[0] = channel1
channels_second[1] = channel2
channels_second[2] = channel3
//Second Way
channels_second := make([]chan int, 3)
channels_second[0] = channel1
channels_second[1] = channel2
channels_second[2] = channel3

fmt.Println("\nOutput for Second slice of channels")
for _, c := range channels_second {
fmt.Println(c)
}
fmt.Println("\nOutput for Second slice of channels")
for _, c := range channels_second {
fmt.Println(c)
}
}
1 change: 0 additions & 1 deletion examples/waitGroupTest.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ func main() {
wg.Wait()
fmt.Println("Main: Completed")
}

2 changes: 2 additions & 0 deletions internal/conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ func parseTui(ini *ginip.Ini) error {
Borders = sterm.AsciiBorders
case "dot":
Borders = sterm.DotBorders
default:
return &BorderIsIncorrect{conf.(string)}
}

conf, err = ini.GetValueBool(sect, colorsVar)
Expand Down
9 changes: 8 additions & 1 deletion internal/conf/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ type ColorOutOfRangeError struct {
Name string
}

type BorderIsIncorrect struct {
Name string
}

func (e *ColorOutOfRangeError) Error() string {
return fmt.Sprintf("%s var color is out or range. plz check your conf file for correctness", e.Name)
}

func (e *BorderIsIncorrect) Error() string {
return fmt.Sprintf("'%s' border type is incorrect", e.Name)
}

var ErrConfFileNotExist = errors.New("conf file not exists")
var ErrNoConfFiles = errors.New("no conf files finded in system")

2 changes: 1 addition & 1 deletion internal/self/commit.dat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5c5cf2b
83d4a86
2 changes: 2 additions & 0 deletions scripts/contribute.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
go fmt ./...
go generate ./...
7 changes: 6 additions & 1 deletion scripts/release.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
asd
CGO_ENABLED=0

go generate ./...
GOARCH=386 go build -ldflags="-s -w" -gcflags=all="-B -C" -o "release/zfxtop_386" cmd/zfxtop/zfxtop.go
GOARCH=amd64 go build -ldflags="-s -w" -gcflags=all="-B -C" -o "release/zfxtop_amd64" cmd/zfxtop/zfxtop.go
# sorry but now without arm support(

0 comments on commit 85d3937

Please sign in to comment.