diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-01-22 17:35:45 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-01-22 17:35:45 -0500 |
| commit | 2a14395beedc4b3cef74dd7d8b44f14bb8a7ac79 (patch) | |
| tree | 4216df7bc1ae2404c3fef879987eab50bbe89260 /util/util.go | |
| parent | 4f6384f449b50a95255837b1fc394b4ebe14caaf (diff) | |
| parent | 9ad538983290fbd62da7f8d6db5a6dfe123a25c3 (diff) | |
| download | volute-2a14395beedc4b3cef74dd7d8b44f14bb8a7ac79.zip | |
merge backend refactoring from main
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 b0eae51..0000000 --- a/util/util.go +++ /dev/null @@ -1,31 +0,0 @@ -package util - -import ( - "fmt" - "os" - - "volute/mass" - "volute/pressure" - "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:]...) -} |