diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2022-05-27 22:39:03 -0230 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2022-05-27 22:39:03 -0230 |
| commit | 31605150d3e10b08dad2086005c64664f5648a51 (patch) | |
| tree | 7419f90e7b30d3de52595f25852e9ef87094718c /util/util.go | |
| parent | 585fbf852c1e76470df42ebe99ede62440ce19d9 (diff) | |
| download | volute-31605150d3e10b08dad2086005c64664f5648a51.zip | |
prepare to switch ui library
Diffstat (limited to 'util/util.go')
| -rw-r--r-- | util/util.go | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/util/util.go b/util/util.go deleted file mode 100644 index 5812ee1..0000000 --- a/util/util.go +++ /dev/null @@ -1,31 +0,0 @@ -package util - -import ( - "fmt" - "os" - - "github.com/sam-anthony/volute/mass" - "github.com/sam-anthony/volute/pressure" - "github.com/sam-anthony/volute/temperature" -) - -func Check(err error) { - if err != nil { - fmt.Println(err) - os.Exit(1) - } -} - -func Insert[T int32 | float32 | temperature.Temperature | pressure.Pressure | mass.FlowRate](slice []T, elem T, i int) []T { - return append( - slice[:i], - append( - []T{elem}, - slice[i:]..., - )..., - ) -} - -func Remove[T int32 | float32 | temperature.Temperature | pressure.Pressure | mass.FlowRate](slice []T, i int) []T { - return append(slice[:i], slice[i+1:]...) -} |