mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 02:57:46 +00:00
Lint: lint and fix src/{os,reflect} (#4228)
* lint: expand to src/{os,reflect}, fix or suppress what it found
* internal/tools/tools.go: the tools idiom requires a build tag guard to avoid go test complaints
This commit is contained in:
@@ -310,6 +310,7 @@ func (e *LinkError) Unwrap() error {
|
||||
return e.Err
|
||||
}
|
||||
|
||||
// OpenFile flag values.
|
||||
const (
|
||||
O_RDONLY int = syscall.O_RDONLY
|
||||
O_WRONLY int = syscall.O_WRONLY
|
||||
|
||||
+2
-2
@@ -7,8 +7,8 @@
|
||||
package os
|
||||
|
||||
const (
|
||||
PathSeparator = '/' // OS-specific path separator
|
||||
PathListSeparator = ':' // OS-specific path list separator
|
||||
PathSeparator = '/' // PathSeparator is the OS-specific path separator
|
||||
PathListSeparator = ':' // PathListSeparator is the OS-specific path list separator
|
||||
)
|
||||
|
||||
// IsPathSeparator reports whether c is a directory separator character.
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
package os
|
||||
|
||||
const (
|
||||
PathSeparator = '\\' // OS-specific path separator
|
||||
PathListSeparator = ';' // OS-specific path list separator
|
||||
PathSeparator = '\\' // PathSeparator is the OS-specific path separator
|
||||
PathListSeparator = ';' // PathListSeparator is the OS-specific path list separator
|
||||
)
|
||||
|
||||
// IsPathSeparator reports whether c is a directory separator character.
|
||||
|
||||
@@ -489,7 +489,7 @@ func TestTinyStruct(t *testing.T) {
|
||||
|
||||
func TestTinyZero(t *testing.T) {
|
||||
s := "hello, world"
|
||||
var sptr *string = &s
|
||||
sptr := &s
|
||||
v := ValueOf(&sptr).Elem()
|
||||
v.Set(Zero(v.Type()))
|
||||
|
||||
@@ -535,7 +535,7 @@ func TestTinyAddr(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTinyNilType(t *testing.T) {
|
||||
var a any = nil
|
||||
var a any
|
||||
typ := TypeOf(a)
|
||||
if typ != nil {
|
||||
t.Errorf("Type of any{nil} is not nil")
|
||||
|
||||
Reference in New Issue
Block a user