sync/waitgroup: initial sync.WaitGroup wrapper with context support (#319)
Some checks failed
/ autoupdate (push) Failing after 1m12s
Some checks failed
/ autoupdate (push) Failing after 1m12s
Reviewed-on: #319 Co-authored-by: Vasiliy Tolstov <v.tolstov@unistack.org> Co-committed-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -12,7 +12,7 @@ type EC2Metadata struct {
|
||||
InstanceType string `json:"instance-type"`
|
||||
LocalHostname string `json:"local-hostname"`
|
||||
LocalIPv4 string `json:"local-ipv4"`
|
||||
kernelID int `json:"kernel-id"`
|
||||
KernelID int `json:"kernel-id"`
|
||||
Placement string `json:"placement"`
|
||||
AvailabilityZone string `json:"availability-zone"`
|
||||
ProductCodes string `json:"product-codes"`
|
||||
|
||||
@@ -67,9 +67,9 @@ func (fi *fileInfo) Name() string {
|
||||
|
||||
func (fi *fileInfo) Mode() os.FileMode {
|
||||
if strings.HasSuffix(fi.name, "/") {
|
||||
return os.FileMode(0755) | os.ModeDir
|
||||
return os.FileMode(0o755) | os.ModeDir
|
||||
}
|
||||
return os.FileMode(0644)
|
||||
return os.FileMode(0o644)
|
||||
}
|
||||
|
||||
func (fi *fileInfo) IsDir() bool {
|
||||
@@ -112,15 +112,14 @@ func (f *file) Readdir(count int) ([]os.FileInfo, error) {
|
||||
func (f *file) Seek(offset int64, whence int) (int64, error) {
|
||||
// log.Printf("seek %d %d %s\n", offset, whence, f.name)
|
||||
switch whence {
|
||||
case os.SEEK_SET:
|
||||
case io.SeekStart:
|
||||
f.offset = offset
|
||||
case os.SEEK_CUR:
|
||||
case io.SeekCurrent:
|
||||
f.offset += offset
|
||||
case os.SEEK_END:
|
||||
case io.SeekEnd:
|
||||
f.offset = int64(len(f.data)) + offset
|
||||
}
|
||||
return f.offset, nil
|
||||
|
||||
}
|
||||
|
||||
func (f *file) Stat() (os.FileInfo, error) {
|
||||
|
||||
@@ -2,7 +2,7 @@ package structfs
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net/http"
|
||||
"reflect"
|
||||
"testing"
|
||||
@@ -82,7 +82,7 @@ func get(path string) ([]byte, error) {
|
||||
return nil, err
|
||||
}
|
||||
defer res.Body.Close()
|
||||
return ioutil.ReadAll(res.Body)
|
||||
return io.ReadAll(res.Body)
|
||||
}
|
||||
|
||||
func TestAll(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user