From a20bd674ab007059d29b19d96043b11308108d17 Mon Sep 17 00:00:00 2001 From: Yiyang Kang Date: Sun, 20 Nov 2022 14:47:49 +0800 Subject: [PATCH] Initial commit --- README.md | 11 ++++++++++- go.mod | 3 +++ lib.go | 7 +++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 go.mod create mode 100644 lib.go diff --git a/README.md b/README.md index 14779eb..da9881a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,11 @@ -# singlethreaded +# Usage +```go +import ( + _ "git.gensokyo.cafe/go/singlethreaded" + + // your other imports +) +``` + +Put the import on the top of the import list in your main package. diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..f8b918b --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module git.gensokyo.cafe/go/singlethreaded + +go 1.19 diff --git a/lib.go b/lib.go new file mode 100644 index 0000000..dda460b --- /dev/null +++ b/lib.go @@ -0,0 +1,7 @@ +package singlethreaded + +import "runtime" + +func init() { + runtime.GOMAXPROCS(1) +}