1 Star 1 Fork 0

Bin/goscript

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
stdlib.go 396 Bytes
Copy Edit Raw Blame History
YouBin authored 2025-03-02 16:25 +08:00 . 采用原型链优化fork的表现形式
package goscript
import (
"fmt"
"reflect"
"strings"
)
// 注册标准库包
func (i *Interpreter) libs() {
// strings 包
i.Set("strings", map[string]any{
"Builder": reflect.TypeOf(strings.Builder{}),
"Join": strings.Join,
"Split": strings.Split,
})
// fmt 包
i.Set("fmt", map[string]any{
"Println": fmt.Println,
"Printf": fmt.Printf,
"Sprintf": fmt.Sprintf,
})
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/llyb120/goscript.git
git@gitee.com:llyb120/goscript.git
llyb120
goscript
goscript
v0.0.13

Search