From 760582df35de027588ae4d85d302172ad1179ab0 Mon Sep 17 00:00:00 2001 From: amy Date: Mon, 7 Oct 2024 15:17:37 +0330 Subject: [PATCH] init --- README.md | 3 +++ go.mod | 3 +++ main.go | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 README.md create mode 100644 go.mod create mode 100644 main.go diff --git a/README.md b/README.md new file mode 100644 index 0000000..6d0c900 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# json commented, sister kissed. +jsonc is bloat. who the fuck needs inline comments? it adds unnecessary complications. +say hello to JCSK. simple as fuck. 30 lines of code, can probably be shorter if ya wanna \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..222b696 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module git.incest.world/sisterkissers/jcsk + +go 1.23.2 diff --git a/main.go b/main.go new file mode 100644 index 0000000..d962d1a --- /dev/null +++ b/main.go @@ -0,0 +1,33 @@ +package main + +import ( + "fmt" + "io" + "os" + "strings" +) + +func main() { + jsoninput := "" + output := []string{} + info, _ := os.Stdin.Stat() + if info.Mode()&os.ModeCharDevice == 0 { + guh, _ := io.ReadAll(os.Stdin) + jsoninput = string(guh) + print(jsoninput) + } else if len(os.Args) > 1 { + penis, err := os.ReadFile(os.Args[1]) + if err != nil { + fmt.Println("something something readfile failed") + os.Exit(1) + } + jsoninput = string(penis) + } + for _, i := range strings.Split(jsoninput, "\n") { + if strings.HasPrefix(strings.TrimSpace(i), "//") { + continue + } + output = append(output, i) + } + fmt.Println(strings.Join(output, "\n")) +}