diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-02-25 21:40:09 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-02-25 21:40:09 +0000 |
commit | ed9085d4e5d4944ab662a58ee3a33d3b5210bd3e (patch) | |
tree | ae6b893d1b673b9020cf1cf3d66c5071e492d7fb /pkg/fspath/builder.go | |
parent | a59ee560978159013ade1bfb878d39cf9c551476 (diff) | |
parent | 471b15b212831af31c2fe36cd42cea7ec7b7785b (diff) |
Merge release-20200219.0-37-g471b15b (automated)
Diffstat (limited to 'pkg/fspath/builder.go')
-rwxr-xr-x | pkg/fspath/builder.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/fspath/builder.go b/pkg/fspath/builder.go index 7ddb36826..6318d3874 100755 --- a/pkg/fspath/builder.go +++ b/pkg/fspath/builder.go @@ -16,6 +16,8 @@ package fspath import ( "fmt" + + "gvisor.dev/gvisor/pkg/gohacks" ) // Builder is similar to strings.Builder, but is used to produce pathnames @@ -102,3 +104,9 @@ func (b *Builder) AppendString(str string) { copy(b.buf[b.start:], b.buf[oldStart:]) copy(b.buf[len(b.buf)-len(str):], str) } + +// String returns the accumulated string. No other methods should be called +// after String. +func (b *Builder) String() string { + return gohacks.StringFromImmutableBytes(b.buf[b.start:]) +} |