From e575b71f071674d425f8857ea48d3552ef0d0962 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 29 Feb 2024 13:45:36 -0600 Subject: [PATCH] start droplet --- Makefile | 14 ++++++++++++-- area.go | 1 - droplet.go | 30 ++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 droplet.go diff --git a/Makefile b/Makefile index db875cc..b41f0b4 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,16 @@ -all: +GUIVERSION = $(shell cd ~/go/src/go.wit.com/gui; git describe --tags) + +all: build + +vet: @#GO111MODULE=off go build @GO111MODULE=off go vet -x @echo this go library package builds okay build: - @GO111MODULE=off go build -x -o junk + @GO111MODULE=off go build -v -x -o junk \ + -ldflags "-X main.GUIVERSION=${GUIVERSION}" \ + -ldflags "-X go.wit.com/gui.GUIVERSION=${GUIVERSION}" ./junk goimports: @@ -16,3 +22,7 @@ redomod: GO111MODULE= go mod init GO111MODULE= go mod tidy + +actual: redomod + GO111MODULE= go build -x -o junk + ./junk diff --git a/area.go b/area.go index 539e0d9..88c94b6 100644 --- a/area.go +++ b/area.go @@ -48,7 +48,6 @@ func main() { l := Less(c, s) fmt.Printf("%v is the smallest\n", l) - } func Less(s1, s2 Sizer) Sizer { diff --git a/droplet.go b/droplet.go new file mode 100644 index 0000000..878a64f --- /dev/null +++ b/droplet.go @@ -0,0 +1,30 @@ +package main + +import ( + "fmt" + + "go.wit.com/gui" +) + +type Size interface { + Cpus() int + Memory() float64 + Disk() float64 +} + +type Menu interface { + Widget() *gui.Node +} + +type Draw interface { + Show() bool + Hide() +} + +type Droplet interface { + Draw + Menu + Size + // Location + fmt.Stringer +}