The String is a special fella. Like ints, or bools, you might think it will only have a Value property, the string itself. TA-DA! No, we also have an Ok and Done properties that are used when running shell commands -- since the shell will return strings. So, look at this: cmd = `ls -la` type(cmd
| 211 | // cmd.wait() // ... |
| 212 | // cmd.done // TRUE |
| 213 | type String struct { |
| 214 | Token token.Token |
| 215 | Value string |
| 216 | Ok *Boolean // A special property to check whether a command exited correctly |
| 217 | Cmd *exec.Cmd // A special property to access the underlying command |
| 218 | Stdout *bytes.Buffer |
| 219 | Stderr *bytes.Buffer |
| 220 | Done *Boolean |
| 221 | mux *sync.Mutex |
| 222 | } |
| 223 | |
| 224 | func (s *String) Type() ObjectType { return STRING_OBJ } |
| 225 | func (s *String) Inspect() string { return s.Value } |
nothing calls this directly
no outgoing calls
no test coverage detected