From d88c3112bd34cfc9372950fda7c58eebf8d22e8e Mon Sep 17 00:00:00 2001 From: surdeus Date: Sun, 27 Aug 2023 15:41:30 +0300 Subject: [PATCH] Shorter package names. --- {src/cmd => cmd}/ll/main.go | 11 ++-- {src/iterx => iterx}/chan.go | 0 {src/iterx => iterx}/iter.go | 4 +- {src/iterx => iterx}/misc.go | 0 {src/llx => llx}/main.go | 0 {src/mapx => mapx}/main.go | 0 {src/mapx => mapx}/misc.go | 0 {src/mapx => mapx}/ordered.go | 0 {src/mapx => mapx}/uniq.go | 0 mkfile | 8 +-- {src/poolx => poolx}/main.go | 0 {src/rangex => rangex}/range.go | 0 {src/slicex => slicex}/main.go | 0 {src/sparsex => sparsex}/main.go | 0 src/cmd/pool/main.go | 26 ---------- src/cmd/sparse/main.go | 23 --------- src/cmd/test/main.go | 86 -------------------------------- 17 files changed, 10 insertions(+), 148 deletions(-) rename {src/cmd => cmd}/ll/main.go (61%) rename {src/iterx => iterx}/chan.go (100%) rename {src/iterx => iterx}/iter.go (85%) rename {src/iterx => iterx}/misc.go (100%) rename {src/llx => llx}/main.go (100%) rename {src/mapx => mapx}/main.go (100%) rename {src/mapx => mapx}/misc.go (100%) rename {src/mapx => mapx}/ordered.go (100%) rename {src/mapx => mapx}/uniq.go (100%) rename {src/poolx => poolx}/main.go (100%) rename {src/rangex => rangex}/range.go (100%) rename {src/slicex => slicex}/main.go (100%) rename {src/sparsex => sparsex}/main.go (100%) delete mode 100644 src/cmd/pool/main.go delete mode 100644 src/cmd/sparse/main.go delete mode 100644 src/cmd/test/main.go diff --git a/src/cmd/ll/main.go b/cmd/ll/main.go similarity index 61% rename from src/cmd/ll/main.go rename to cmd/ll/main.go index ebaa7f8..198db3e 100644 --- a/src/cmd/ll/main.go +++ b/cmd/ll/main.go @@ -1,19 +1,14 @@ package main import ( - "github.com/mojosa-software/godat/src/llx" - "fmt" + "github.com/mojosa-software/godat/llx" ) func main() { ll := llx.New[string]("zero", "one", "two", "three", "four", "five") - + ll.Push("-one", "-two") + ll.Swap(0, 2) - - for el := range ll.Chan() { - fmt.Println(el) - } fmt.Println(ll.Slice()) } - diff --git a/src/iterx/chan.go b/iterx/chan.go similarity index 100% rename from src/iterx/chan.go rename to iterx/chan.go diff --git a/src/iterx/iter.go b/iterx/iter.go similarity index 85% rename from src/iterx/iter.go rename to iterx/iter.go index 22acec7..53ddbc7 100644 --- a/src/iterx/iter.go +++ b/iterx/iter.go @@ -2,8 +2,8 @@ package iterx // Implementing the interface lets us iterate through the // the data by lightweight channels. -type Channeler[K any, V any] interface { - Chan() PairChan[K, V] +type Channeler[V any] interface { + Chan() chan V } // Implementing the interface provides the way to diff --git a/src/iterx/misc.go b/iterx/misc.go similarity index 100% rename from src/iterx/misc.go rename to iterx/misc.go diff --git a/src/llx/main.go b/llx/main.go similarity index 100% rename from src/llx/main.go rename to llx/main.go diff --git a/src/mapx/main.go b/mapx/main.go similarity index 100% rename from src/mapx/main.go rename to mapx/main.go diff --git a/src/mapx/misc.go b/mapx/misc.go similarity index 100% rename from src/mapx/misc.go rename to mapx/misc.go diff --git a/src/mapx/ordered.go b/mapx/ordered.go similarity index 100% rename from src/mapx/ordered.go rename to mapx/ordered.go diff --git a/src/mapx/uniq.go b/mapx/uniq.go similarity index 100% rename from src/mapx/uniq.go rename to mapx/uniq.go diff --git a/mkfile b/mkfile index c5540db..5911453 100644 --- a/mkfile +++ b/mkfile @@ -1,5 +1,7 @@ -