]> git.lizzy.rs Git - mt.git/blobdiff - stack.go
Add WaitGroup to SerializePkt
[mt.git] / stack.go
index 4e7cc18c57a2d566b7c7a26367a9767c1df84e15..8cf3aa84a314d7a714380f27ae0789348a355c6a 100644 (file)
--- a/stack.go
+++ b/stack.go
@@ -1,5 +1,8 @@
-// In this file, JSON refers to WTF-JSON, a variant of JSON used by Minetest
+// In this file, JSON refers to WTF-JSON.
+//
+// BUG(mt): Stackstrings use variant of JSON called WTF-JSON
 // where \u00XX escapes in string literals act like Go's \xXX escapes.
+// This should not be fixed because it would break existing items.
 
 package mt
 
@@ -22,6 +25,7 @@ type Item struct {
        ItemMeta
 }
 
+// String returns the Stack's stackstring.
 func (s Stack) String() string {
        if s.Count == 0 {
                return ""
@@ -83,6 +87,7 @@ func jsonStr(s string) string {
        return b.String()
 }
 
+// Scan scans a stackstring, implementing the fmt.Scanner interface.
 func (stk *Stack) Scan(state fmt.ScanState, verb rune) (err error) {
        *stk = Stack{}