mirror of
https://github.com/dragonheim/gagent.git
synced 2025-04-26 12:48:58 -07:00
refactor: converted int64 to int32 where appropriate.
refactor: reduced usage of fmt in favor of logs and string concatication. refactor: minor re-ordering of the data structures to reduce storage space required.
This commit is contained in:
parent
8640d42132
commit
1bcc682b7c
9 changed files with 53 additions and 48 deletions
|
@ -12,20 +12,10 @@ import (
|
|||
|
||||
var fname = flag.String("f", "", "file name")
|
||||
|
||||
// CommandPuts is a simple version of the TCL puts function.
|
||||
func CommandPuts(i *picol.Interpreter, argv []string, pd interface{}) (string, error) {
|
||||
if len(argv) != 2 {
|
||||
return "", fmt.Errorf("wrong number of args for %s %s", argv[0], argv)
|
||||
}
|
||||
fmt.Println(argv[1])
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
interp := picol.NewInterpreter()
|
||||
interp.RegisterCoreCommands()
|
||||
interp.RegisterCommand("puts", CommandPuts, nil)
|
||||
|
||||
buf, err := ioutil.ReadFile(*fname)
|
||||
if err == nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue