-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
43 lines (33 loc) · 809 Bytes
/
main.go
File metadata and controls
43 lines (33 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (c) The kotama Authors. All Rights Reserved.
//
// Use of this source code is governed by the license
// that can be found in the LICENSE file.
package main
import (
"fmt"
"log"
"math"
"os"
"runtime"
"runtime/debug"
"github.com/usbarmory/kotama/cmd"
"github.com/usbarmory/tamago-example/shell"
)
func init() {
log.SetFlags(0)
log.SetOutput(os.Stdout)
_, ramEnd := runtime.MemRegion()
dataStart, _ := runtime.DataRegion()
memoryLimit := float64(ramEnd-dataStart) * 0.90
debug.SetMemoryLimit(int64(math.Round(memoryLimit)))
}
func main() {
banner := fmt.Sprintf("%s/%s (%s) • %s",
runtime.GOOS, runtime.GOARCH, runtime.Version(), "こたま")
console := &shell.Interface{
Banner: banner,
ReadWriter: cmd.Terminal,
}
console.Start(true)
log.Printf("exit")
}