From a88986a89e8711c8aa1fec71e139bece7e72625d Mon Sep 17 00:00:00 2001 From: surdeus Date: Thu, 6 Jun 2024 11:14:30 +0500 Subject: [PATCH] feat: update xgo. --- go.mod | 9 +++++++-- go.sum | 10 ++++++++-- main.go | 2 ++ xgo_test.xgo | 6 ++++++ 4 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 xgo_test.xgo diff --git a/go.mod b/go.mod index fbbf7c9..352f51f 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,10 @@ module surdeus.su/util/bb -go 1.21.9 +go 1.22.3 -require surdeus.su/core/cli v0.0.2 +require ( + surdeus.su/core/cli v0.1.2 + surdeus.su/core/xgo v0.1.0 +) + +require github.com/d5/tengo/v2 v2.17.0 // indirect diff --git a/go.sum b/go.sum index bdb438a..6142bea 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,8 @@ -surdeus.su/core/cli v0.0.2 h1:RdHHk3/Fhwxz9PjaE+vTlCuF9KmhrmNUb5y4oqulrYI= -surdeus.su/core/cli v0.0.2/go.mod h1:UKwCmcSX+x7XX9aF3gOaaAaJcJA3gtUmL4vdnM43+fM= +github.com/d5/tengo/v2 v2.17.0 h1:BWUN9NoJzw48jZKiYDXDIF3QrIVZRm1uV1gTzeZ2lqM= +github.com/d5/tengo/v2 v2.17.0/go.mod h1:XRGjEs5I9jYIKTxly6HCF8oiiilk5E/RYXOZ5b0DZC8= +surdeus.su/core/cli v0.1.2 h1:qPzjawqPyZsO4Z5SaA1u141recVE65yioA83Qs7Jecs= +surdeus.su/core/cli v0.1.2/go.mod h1:r9JtQz3aEJzpYzMaNUNQHJoYkoWKNPi047qhd5uGlmA= +surdeus.su/core/xgo v0.0.2 h1:ZwYugS9dBoT1CdfkUjaOFXTgal0CZgopsrP8ozTGfAc= +surdeus.su/core/xgo v0.0.2/go.mod h1:6C/AHbjfvAMvt3TOzLB4eIZ40eU3ahJXtdY+kr4yXoc= +surdeus.su/core/xgo v0.1.0 h1:kpH4my7rK+C6Kx9bG7BB95F3T+kx8+MQEvm/APRiyNY= +surdeus.su/core/xgo v0.1.0/go.mod h1:6C/AHbjfvAMvt3TOzLB4eIZ40eU3ahJXtdY+kr4yXoc= diff --git a/main.go b/main.go index e2723d0..6b425a2 100644 --- a/main.go +++ b/main.go @@ -26,6 +26,7 @@ import ( "surdeus.su/util/bb/tool/wc" "surdeus.su/util/bb/tool/whoami" "surdeus.su/util/bb/tool/yes" + xgotool "surdeus.su/core/xgo/xtool" "os" ) @@ -119,6 +120,7 @@ var root = mtool.T("bb").Subs( }).Desc( "print all the environment variables", ), + xgotool.Tool, ).Desc( "not POSIX compatible BusyBox utilities", ) diff --git a/xgo_test.xgo b/xgo_test.xgo new file mode 100644 index 0000000..33f5f51 --- /dev/null +++ b/xgo_test.xgo @@ -0,0 +1,6 @@ +fmt := import("fmt") +fmt.println("Hello, World!") + +for _, i in [15, 573, 53] { + fmt.println(i) +}