main
Bel LaPointe 2023-12-12 08:18:11 -07:00
parent 8630d35693
commit 9d248b99ba
1 changed files with 21 additions and 0 deletions

21
main.go Normal file
View File

@ -0,0 +1,21 @@
package main
import (
"encoding/json"
"fmt"
"os"
)
func main() {
format := os.Args[1]
args := os.Args[2:]
printfs := make([]any, len(args))
for i := range args {
var v interface{}
printfs[i] = args[i]
if err := json.Unmarshal([]byte(args[i]), &v); err == nil {
printfs[i] = v
}
}
fmt.Printf(format, printfs...)
}