-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Detect opposite feature * self-review fixes * self-review fixes
- Loading branch information
Showing
13 changed files
with
346 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package examples | ||
|
||
import ( | ||
"bytes" | ||
"errors" | ||
"fmt" | ||
"io" | ||
"net" | ||
"unsafe" | ||
) | ||
|
||
func primitivePtrTypeOpposite() (*int, error) { | ||
if false { | ||
return nil, io.EOF | ||
} | ||
return new(int), errors.New("validation failed") | ||
} | ||
|
||
func structPtrTypeOpposite() (*User, error) { | ||
if false { | ||
return nil, io.EOF | ||
} | ||
return new(User), fmt.Errorf("invalid %v", 42) | ||
} | ||
|
||
func unsafePtrOpposite() (unsafe.Pointer, error) { | ||
if false { | ||
return nil, io.EOF | ||
} | ||
var i int | ||
return unsafe.Pointer(&i), io.EOF | ||
} | ||
|
||
func uintPtrOpposite() (uintptr, error) { | ||
if false { | ||
return 0, io.EOF | ||
} | ||
return 0xc82000c290, wrap(io.EOF) | ||
} | ||
|
||
func channelTypeOpposite() (ChannelType, error) { | ||
if false { | ||
return nil, io.EOF | ||
} | ||
return make(ChannelType), fmt.Errorf("wrapped: %w", io.EOF) | ||
} | ||
|
||
func funcTypeOpposite() (FuncType, error) { | ||
if false { | ||
return nil, io.EOF | ||
} | ||
return func(i int) int { | ||
return 0 | ||
}, errors.New("no func type, please") | ||
} | ||
|
||
func ifaceTypeOpposite() (io.Reader, error) { | ||
if false { | ||
return nil, io.EOF | ||
} | ||
return new(bytes.Buffer), new(net.AddrError) | ||
} |
Oops, something went wrong.