Comments (7)
Sorry, I should have mentioned those details earlier. I am using:
$ go version
go version go1.19.6 linux/amd64
But I am not just running refactoring
though, so other items fail as well. Besides the compile failures, there is also engine/cli
:
ok github.com/godoctor/godoctor/engine (cached)
--- FAIL: TestRenameDiff (0.09s)
cli_test.go:206: Rename expected exit code 0; got 3
--- FAIL: TestRenameComplete (0.17s)
cli_test.go:217: Rename expected exit code 0; got 3
--- FAIL: TestOneRefactoringOneParam (0.05s)
cli_test.go:348: One refactoring with one arg, no input expected exit 0
FAIL
FAIL github.com/godoctor/godoctor/engine/cli 0.456s
And for refactoring
I get something like:
Extract Function testdata/extractfunc/005-param-passing-and-return/main.go
>>>>> Output does not match /home/elliott/code/go/godoctor/refactoring/testdata/extractfunc/005-param-passing-and-return/main.golden
EXPECTED OUTPUT
vvvvvvvvvvvvvvv
//<<<<<extract,10,2,14,15,Foo,pass
package main
import "fmt"
func main() {
a := 3 + 0
b := a
c := 1 + 0
a, x := Foo(a, b)
z := a + x + c
fmt.Println(z)
}
func Foo(a int, b int) (int, int) {
for a <= b {
a += b
}
x := a + b
fmt.Println(x)
return a, x
}
^^^^^^^^^^^^^^^
ACTUAL OUTPUT
vvvvvvvvvvvvv
// <<<<<extract,10,2,14,15,Foo,pass
package main
import "fmt"
func main() {
a := 3 + 0
b := a
c := 1 + 0
a, x := Foo(a, b)
z := a + x + c
fmt.Println(z)
}
func Foo(a int, b int) (int, int) {
for a <= b {
a += b
}
x := a + b
fmt.Println(x)
return a, x
}
^^^^^^^^^^^^^
Length of expected output is 268; length of actual output is 269
Strings differ at index 2
Substrings starting at that index are:
Expected: [<<<<<extra]
Actual: [ <<<<<extr]
for many tests. But there's also a small space change in, e.g.,:
Add GoDoc testdata/godoc/014-consistent-comment-style/main.go
>>>>> Output does not match /home/elliott/code/go/godoctor/refactoring/testdata/godoc/014-consistent-comment-style/main.golden
EXPECTED OUTPUT
vvvvvvvvvvvvvvv
package main // <<<<< godoc,1,1,1,1,pass
type (
// A is a type
A int
// B TODO: NEEDS COMMENT INFO
B int
c string
)
const (
// StatusOk TODO: NEEDS COMMENT INFO
StatusOk = 1
// StatusBad is bad
StatusBad = 2
)
// TODO: NEEDS COMMENT INFO
var (
Foo = "Foo"
Bar = "Bar"
)
func main() {
}
^^^^^^^^^^^^^^^
ACTUAL OUTPUT
vvvvvvvvvvvvv
package main // <<<<< godoc,1,1,1,1,pass
type (
// A is a type
A int
// B TODO: NEEDS COMMENT INFO
B int
c string
)
const (
// StatusOk TODO: NEEDS COMMENT INFO
StatusOk = 1
// StatusBad is bad
StatusBad = 2
)
// TODO: NEEDS COMMENT INFO
var (
Foo = "Foo"
Bar = "Bar"
)
func main() {
}
^^^^^^^^^^^^^
Length of expected output is 302; length of actual output is 301
Strings differ at index 225
Substrings starting at that index are:
Expected: [ TODO: NEE]
Actual: [TODO: NEED]
from godoctor.
New test failures with Go 1.21rc3:
Debug Refactoring testdata/debug/showast/main.go
>>>>> Debug output does not match contents of testdata/debug/showast/main.go.debugOutput
>>>>> NOTE: All occurrences of the working directory name are replaced by "."
EXPECTED OUTPUT
vvvvvvvvvvvvvvv
0 *ast.File {
1 . Doc: nil
2 . Package: ./testdata/debug/showast/main.go:1:1
3 . Name: *ast.Ident {
4 . . NamePos: ./testdata/debug/showast/main.go:1:9
5 . . Name: "main"
6 . . Obj: nil
7 . }
8 . Decls: nil
9 . FileStart: ./testdata/debug/showast/main.go:1:1
10 . FileEnd: ./testdata/debug/showast/main.go:1:48
11 . Scope: *ast.Scope {
12 . . Outer: nil
13 . . Objects: map[string]*ast.Object (len = 0) {}
14 . }
15 . Imports: nil
16 . Unresolved: nil
17 . Comments: []*ast.CommentGroup (len = 1) {
18 . . 0: *ast.CommentGroup {
19 . . . List: []*ast.Comment (len = 1) {
20 . . . . 0: *ast.Comment {
21 . . . . . Slash: ./testdata/debug/showast/main.go:1:14
22 . . . . . Text: "//<<<<<debug,1,1,1,1,showast,pass"
23 . . . . }
24 . . . }
25 . . }
26 . }
27 }
^^^^^^^^^^^^^^^
ACTUAL OUTPUT
vvvvvvvvvvvvv
0 *ast.File {
1 . Doc: nil
2 . Package: ./testdata/debug/showast/main.go:1:1
3 . Name: *ast.Ident {
4 . . NamePos: ./testdata/debug/showast/main.go:1:9
5 . . Name: "main"
6 . . Obj: nil
7 . }
8 . Decls: nil
9 . FileStart: ./testdata/debug/showast/main.go:1:1
10 . FileEnd: ./testdata/debug/showast/main.go:1:48
11 . Scope: *ast.Scope {
12 . . Outer: nil
13 . . Objects: map[string]*ast.Object (len = 0) {}
14 . }
15 . Imports: nil
16 . Unresolved: nil
17 . Comments: []*ast.CommentGroup (len = 1) {
18 . . 0: *ast.CommentGroup {
19 . . . List: []*ast.Comment (len = 1) {
20 . . . . 0: *ast.Comment {
21 . . . . . Slash: ./testdata/debug/showast/main.go:1:14
22 . . . . . Text: "//<<<<<debug,1,1,1,1,showast,pass"
23 . . . . }
24 . . . }
25 . . }
26 . }
27 . GoVersion: ""
28 }
^^^^^^^^^^^^^
Length of expected output is 959; length of actual output is 984
Strings differ at index 957
Substrings starting at that index are:
Expected: [}\n]
Actual: [. GoVersi]
It appears that ast.File
now has a GoVersion
member.
from godoctor.
uh oh. thanks for running the tests. I ran them to make sure on my machine, and with go 1.18 they do still work for me when running go test
from the refactoring/
directory. I will try to update go and reproduce though. can you provide any more info possibly? macos/linux? go version?
from godoctor.
I attempted to fix the compile in #61 (but not the other issues).
from godoctor.
got a repro. updating go to 1.20 has cropped up numerous errors, as posted. thanks for the info! I'll try to whittle away the rest of the tests.
from godoctor.
gonna leave this open for now even though it is scary :) hope to fix the cgo and cli test issues too, but things are in a decent state now from #63
from godoctor.
thanks @QuLogic for catching this - I'm going to wait until release of 1.21 and try to add build constraints to make this somewhat obvious.
from godoctor.
Related Issues (20)
- go get godoctor fails with Go v1.5 HOT 1
- godoctor rename issue HOT 4
- Move away from version numbers? HOT 3
- OpenRefactory JSON protocol documentation is missing HOT 3
- godoc refactoring adds unnecessary comment for types and ignores value declarations HOT 2
- Can't rename struct fields HOT 3
- Go Doctor interactive mode? HOT 2
- Add scope detection based on VCS root HOT 6
- Function Extract failure HOT 7
- Extract Function failure - variable's previous value ignored HOT 2
- Named returns should be live at exit HOT 3
- Cut releases more frequently
- Is this tool actively mantained ? HOT 1
- Does it work with go modules? HOT 7
- Site down http://gorefactor.org/
- it seems like go module cannot work with "Extract to function" in vscode HOT 2
- godoctor causing dockerfile build failure HOT 4
- help!i can not complie master
- Manual not visible HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godoctor.