MCPcopy Create free account
hub / github.com/astercloud/aster / IsInside

Method IsInside

pkg/sandbox/cloud/volcengine.go:220–223  ·  view source on GitHub ↗

IsInside 检查路径是否在沙箱内

(path string)

Source from the content-addressed store, hash-verified

218
219// IsInside 检查路径是否在沙箱内
220func (vfs *VolcengineFS) IsInside(path string) bool {
221 absPath := vfs.absPath(path)
222 return strings.HasPrefix(absPath, vfs.workDir)
223}
224
225// Read 读取文件
226func (vfs *VolcengineFS) Read(ctx context.Context, path string) (string, error) {

Callers

nothing calls this directly

Calls 1

absPathMethod · 0.95

Tested by

no test coverage detected