aboutsummaryrefslogtreecommitdiff
path: root/internal/toml.go
diff options
context:
space:
mode:
authorSlack Coder <slackcoder@server.ky>2024-10-02 16:49:36 -0500
committerSlack Coder <slackcoder@server.ky>2024-10-02 17:01:48 -0500
commit2597c03d1555e00dec59830b7de75e7090208e05 (patch)
tree5642202b4621ea722ee85b322d79bbad17894026 /internal/toml.go
parentb81d017b42cc814e603de2b49e4b78362ae73f2a (diff)
downloadmirror-2597c03d1555e00dec59830b7de75e7090208e05.tar.xz
config: Use TOML
TOML is simple for users, and it is used in notably projects like rustlang. It also provides comments!
Diffstat (limited to 'internal/toml.go')
-rw-r--r--internal/toml.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/toml.go b/internal/toml.go
new file mode 100644
index 0000000..4222921
--- /dev/null
+++ b/internal/toml.go
@@ -0,0 +1,14 @@
+package internal
+
+import (
+ "github.com/BurntSushi/toml"
+)
+
+func MustTOML(arg interface{}) string {
+ buf, err := toml.Marshal(arg)
+ if err != nil {
+ panic(err)
+ }
+
+ return string(buf)
+}