-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add SuggestedFixes for --fix support #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
raeperd
wants to merge
2
commits into
main
Choose a base branch
from
feat/suggested-fixes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,33 @@ | ||
| package basic | ||
|
|
||
| import ( | ||
| "time" | ||
| ) | ||
|
|
||
| type RPC struct { // want `the methods of "RPC" use pointer receiver and non-pointer receiver.` | ||
| result int | ||
| done chan struct{} | ||
| } | ||
|
|
||
| func (rpc *RPC) compute() { | ||
| time.Sleep(time.Second) // strenuous computation intensifies | ||
| rpc.result = 42 | ||
| close(rpc.done) | ||
| } | ||
|
|
||
| func (*RPC) version() int { | ||
| return 1 // never going to need to change this | ||
| } | ||
|
|
||
| // Following main function cause data race error | ||
| // reference: https://dave.cheney.net/2015/11/18/wednesday-pop-quiz-spot-the-race | ||
| // func main() { | ||
| // rpc := &RPC{done: make(chan struct{})} | ||
| // | ||
| // go rpc.compute() // kick off computation in the background | ||
| // version := rpc.version() // grab some other information while we're waiting | ||
| // <-rpc.done // wait for computation to finish | ||
| // result := rpc.result | ||
| // | ||
| // fmt.Printf("RPC computation complete, result: %d, version: %d\n", result, version) | ||
| // } |
This file contains hidden or 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,11 @@ | ||
| package disablebuiltin | ||
|
|
||
| type Binary struct{} // want `the methods of "Binary" use pointer receiver and non-pointer receiver.` | ||
|
|
||
| func (b *Binary) MarshalBinary() ([]byte, error) { | ||
| panic("not implemented") | ||
| } | ||
|
|
||
| func (b *Binary) UnmarshalBinary(data []byte) error { | ||
| panic("not implemented") | ||
| } |
This file contains hidden or 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,11 @@ | ||
| package disablebuiltin | ||
|
|
||
| type Gob struct{} // want `the methods of "Gob" use pointer receiver and non-pointer receiver.` | ||
|
|
||
| func (g *Gob) GobEncode() ([]byte, error) { | ||
| panic("not implemented") | ||
| } | ||
|
|
||
| func (g *Gob) GobDecode(data []byte) error { | ||
| panic("not implemented") | ||
| } |
This file contains hidden or 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,11 @@ | ||
| package disablebuiltin | ||
|
|
||
| type JSON struct{} // want `the methods of "JSON" use pointer receiver and non-pointer receiver.` | ||
|
|
||
| func (j *JSON) MarshalJSON() ([]byte, error) { | ||
| panic("not implemented") | ||
| } | ||
|
|
||
| func (j *JSON) UnmarshalJSON(b []byte) error { | ||
| panic("not implemented") | ||
| } |
This file contains hidden or 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,11 @@ | ||
| package disablebuiltin | ||
|
|
||
| type Text struct{} // want `the methods of "Text" use pointer receiver and non-pointer receiver.` | ||
|
|
||
| func (t *Text) MarshalText() ([]byte, error) { | ||
| panic("not implemented") | ||
| } | ||
|
|
||
| func (t *Text) UnmarshalText(b []byte) error { | ||
| panic("not implemented") | ||
| } |
This file contains hidden or 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,13 @@ | ||
| package disablebuiltin | ||
|
|
||
| import "encoding/xml" | ||
|
|
||
| type XML struct{} // want `the methods of "XML" use pointer receiver and non-pointer receiver.` | ||
|
|
||
| func (x *XML) MarshalXML(e *xml.Encoder, start xml.StartElement) error { | ||
| panic("not implemented") | ||
| } | ||
|
|
||
| func (x *XML) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { | ||
| panic("not implemented") | ||
| } |
This file contains hidden or 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,13 @@ | ||
| package disablebuiltin | ||
|
|
||
| type Node struct{} | ||
|
|
||
| type YAML struct{} // want `the methods of "YAML" use pointer receiver and non-pointer receiver.` | ||
|
|
||
| func (j *YAML) MarshalYAML() (any, error) { | ||
| panic("not implemented") | ||
| } | ||
|
|
||
| func (j *YAML) UnmarshalYAML(value *Node) error { | ||
| panic("not implemented") | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.