Skip to content

Instantly share code, notes, and snippets.

@pavelaron
pavelaron / error.go
Created Mar 29, 2022
Go error handling with generics
View error.go
// Usage e.g.: f := check(os.Create(filePath))
func check[T any] (result T, err error) (output T) {
if err == nil {
return result
}
fmt.Println(err)
panic(err)
}
@pavelaron
pavelaron / robot_lib.py
Last active May 31, 2019
Skeleton file for Revvy robot_lib
View robot_lib.py
class Control:
def terminate_program():
pass
def terminate_all():
pass
def get_global_timer():
pass