diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2026-03-02 17:38:55 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2026-03-02 17:38:55 -0500 |
| commit | 8858a54b5ddb3a2d8a42ecb1a837c02800bc934f (patch) | |
| tree | 2428c445936eb8865c0b7c8f52560e97a44082f3 /internal | |
| parent | c6cd37a6b80d4e5ad1dbf8c8968b818811b8aa54 (diff) | |
| download | gui-8858a54b5ddb3a2d8a42ecb1a837c02800bc934f.zip | |
create lay/strain package
The lay/strain package uses the Cassowary algorithm to solve systems of
layout constraints.
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/log/log.go | 11 | ||||
| -rw-r--r-- | internal/tag/tag.go | 12 |
2 files changed, 23 insertions, 0 deletions
diff --git a/internal/log/log.go b/internal/log/log.go new file mode 100644 index 0000000..545cd98 --- /dev/null +++ b/internal/log/log.go @@ -0,0 +1,11 @@ +package log + +import ( + "log" + "os" +) + +var ( + Out = log.New(os.Stdout, "faiface/gui [info]: ", log.LstdFlags) + Err = log.New(os.Stderr, "faiface/gui [error]: ", log.LstdFlags|log.Llongfile) +) diff --git a/internal/tag/tag.go b/internal/tag/tag.go new file mode 100644 index 0000000..197d2d6 --- /dev/null +++ b/internal/tag/tag.go @@ -0,0 +1,12 @@ +package tag + +type Tagged[V, T any] struct { + Val V + Tag T +} + +func Tag[V, T any](out chan<- Tagged[V, T], in <-chan V, f func(V) T) { + for val := range in { + out <- Tagged[V, T]{val, f(val)} + } +} |