wgcfg: use string cut instead of string split

Signed-off-by: julianknodt <julianknodt@gmail.com>
This commit is contained in:
julianknodt
2021-07-13 10:12:47 -07:00
committed by Julian Knodt
parent 664edbe566
commit d349a3231e
2 changed files with 13 additions and 6 deletions
+2 -1
View File
@@ -7,6 +7,7 @@ package wgcfg
import (
"bufio"
"bytes"
"io"
"reflect"
"runtime"
"testing"
@@ -90,10 +91,10 @@ func BenchmarkFromUAPI(b *testing.B) {
r := bytes.NewReader(buf.Bytes())
b.ReportAllocs()
for i := 0; i < b.N; i++ {
r.Seek(0, io.SeekStart)
_, err := FromUAPI(r)
if err != nil {
b.Errorf("failed from UAPI: %v", err)
}
r.Seek(0, 0)
}
}