more cleanups
This commit is contained in:
parent
96fdfd1338
commit
4bc9fa41b7
15
structs.go
15
structs.go
|
@ -1,9 +1,6 @@
|
|||
// LICENSE: same as the go language itself
|
||||
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
|
||||
// Use of this source code is governed by the GPL 3.0
|
||||
|
||||
// Copyright 2023 WIT.COM
|
||||
|
||||
// all structures and variables are local (aka lowercase)
|
||||
// since the plugin should be isolated to access only
|
||||
// by functions() to insure everything here is run
|
||||
|
@ -20,18 +17,16 @@ import (
|
|||
|
||||
"github.com/awesome-gocui/gocui"
|
||||
|
||||
"go.wit.com/log"
|
||||
log "go.wit.com/log"
|
||||
"go.wit.com/toolkits/tree"
|
||||
)
|
||||
|
||||
// It's probably a terrible idea to call this 'me'
|
||||
// 2025 note: doesn't seem terrible to call this 'me' anymore. notsure.
|
||||
var me config
|
||||
|
||||
var showDebug bool = true
|
||||
var redoWidgets bool = true
|
||||
|
||||
// This is the window that is currently active
|
||||
// var currentWindow *tree.Node
|
||||
var showDebug bool = true // todo: move this into config struct
|
||||
var redoWidgets bool = true // todo: move this into config struct
|
||||
|
||||
// todo: move all this to a protobuf. then, redo all this mess. it got me here, but now it's time to clean it up for good
|
||||
type config struct {
|
||||
|
@ -165,6 +160,8 @@ func (w *guiWidget) Write(p []byte) (n int, err error) {
|
|||
return len(p), nil
|
||||
}
|
||||
|
||||
// this sets the `default` in the structs
|
||||
// this is cool code. thank Alex Flint & other GO devs for this code
|
||||
func Set(ptr interface{}, tag string) error {
|
||||
if reflect.TypeOf(ptr).Kind() != reflect.Ptr {
|
||||
log.Log(ERROR, "Set() Not a pointer", ptr, "with tag =", tag)
|
||||
|
|
Loading…
Reference in New Issue