From d884b519ef74f7edf51f2c964162f0a2fe80846c Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 6 May 2024 08:33:52 +0200 Subject: pkg/flatrpc: refactor names Remove T suffix from object API types. It seems that we will use these types thoughout the code, and the suffix looks alien in Go code. So it's better to remove it before we started using these names more widely. Also add few extensions we will need to move feature checking to the host. --- pkg/host/machine_info.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pkg/host') diff --git a/pkg/host/machine_info.go b/pkg/host/machine_info.go index 476205255..006f880d9 100644 --- a/pkg/host/machine_info.go +++ b/pkg/host/machine_info.go @@ -11,8 +11,8 @@ import ( "github.com/google/syzkaller/pkg/flatrpc" ) -func ReadFiles(files []string) []flatrpc.FileInfoT { - var res []flatrpc.FileInfoT +func ReadFiles(files []string) []flatrpc.FileInfo { + var res []flatrpc.FileInfo for _, glob := range files { glob = filepath.FromSlash(glob) if !strings.Contains(glob, "*") { @@ -21,7 +21,7 @@ func ReadFiles(files []string) []flatrpc.FileInfoT { } matches, err := filepath.Glob(glob) if err != nil { - res = append(res, flatrpc.FileInfoT{ + res = append(res, flatrpc.FileInfo{ Name: glob, Error: err.Error(), }) @@ -34,13 +34,13 @@ func ReadFiles(files []string) []flatrpc.FileInfoT { return res } -func readFile(file string) flatrpc.FileInfoT { +func readFile(file string) flatrpc.FileInfo { data, err := os.ReadFile(file) exists, errStr := true, "" if err != nil { exists, errStr = !os.IsNotExist(err), err.Error() } - return flatrpc.FileInfoT{ + return flatrpc.FileInfo{ Name: file, Exists: exists, Error: errStr, -- cgit mrf-deployment