Răsfoiți Sursa

conformed project to modern golang standards

arianagiroux 1 săptămână în urmă
părinte
comite
f38386197c

+ 2 - 2
main.go → cmd/pingo.go

@@ -13,7 +13,7 @@ import (
 	"flag"
 	"fmt"
 	"os"
-	"pingo/internal/tui"
+	"pingo"
 	"time"
 
 	tea "github.com/charmbracelet/bubbletea"
@@ -30,7 +30,7 @@ func main() {
 		fmt.Println("Must specify hosts!")
 		return
 	}
-	var model = tui.InitialModel(
+	var model = pingo.InitialModel(
 		hosts, time.Duration(*speed), *chartHeight,
 	)
 

+ 0 - 5
issues/re--factor-package-structure/description

@@ -1,5 +0,0 @@
-The package doesn't conform to modern go standards
-
----
-See ssh://git/issues-go.git for better structure standards
-

+ 0 - 1
issues/re--factor-package-structure/status

@@ -1 +0,0 @@
-open

+ 0 - 0
issues/re--factor-package-structure/tags/v0.1


+ 1 - 1
internal/ping/ping.go → ping.go

@@ -1,7 +1,7 @@
 // Defines a wrapper around the system ping binary.
 //
 // NOTE(os): may fail with non-unix compliant system ping binaries.
-package ping
+package pingo
 
 import (
 	"errors"

+ 1 - 1
internal/ping/ping_test.go → ping_test.go

@@ -1,4 +1,4 @@
-package ping
+package pingo
 
 import (
 	"errors"

+ 1 - 1
internal/tui/tui.go → tui.go

@@ -1,6 +1,6 @@
 // TODO(doc): document TUI lifecycle
 // TODO(test): write unittests for types.go
-package tui
+package pingo
 
 import (
 	"fmt"

+ 4 - 5
internal/tui/types.go → types.go

@@ -1,7 +1,6 @@
-package tui
+package pingo
 
 import (
-	"pingo/internal/ping"
 	"time"
 
 	"github.com/charmbracelet/lipgloss"
@@ -22,12 +21,12 @@ func (a *Address) Truncate() (truncated bool) {
 	return false
 }
 
-// Wraps [ping.Ping]
+// Wraps [Ping]
 func (a *Address) Ping() (delay float64, err error) {
-	return ping.Ping(a.Address)
+	return Ping(a.Address)
 }
 
-// Poll pings the affiliated Address and appends it to a.results
+// Poll  the affiliated Address and appends it to a.results
 func (a *Address) Poll() (success bool, err error) {
 	if delay, err := a.Ping(); err == nil {
 		a.results = append(a.results, delay)