Initial commit

This commit is contained in:
g3po 2023-12-01 13:48:47 +01:00
commit 33b14154cf
3 changed files with 38 additions and 0 deletions

16
cmd/O1/main.go Normal file
View File

@ -0,0 +1,16 @@
package main
import (
"fmt"
"log"
"os"
)
func main() {
fmt.Println("Opening file...")
file, err := os.OpenFile("./input.txt", os.O_RDONLY, 0644)
if err != nil {
log.Fatal(err)
}
defer file.Close()
}

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module 01
go 1.21.4

19
internal/utils.go Normal file
View File

@ -0,0 +1,19 @@
package utils
import (
"fmt"
"log"
"os"
)
func Must[T any](obj T, err error) T {
if err != nil {
log.Fatal(err)
}
return obj
}
func Init() []byte {
fmt.Println("Opening file...")
return Must(os.ReadFile("./input.txt"))
}