Skip to content

Commit 53ab4ea

Browse files
committed
tests: add cgo files to autofix
1 parent 9ed79a4 commit 53ab4ea

File tree

4 files changed

+85
-0
lines changed

4 files changed

+85
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//golangcitest:args -Egofumpt
2+
//golangcitest:config_path testdata/gofumpt-fix.yml
3+
//golangcitest:expected_exitcode 0
4+
package p
5+
6+
/*
7+
#include <stdio.h>
8+
#include <stdlib.h>
9+
10+
void myprint(char* s) {
11+
printf("%d\n", s);
12+
}
13+
*/
14+
import "C"
15+
16+
import "fmt"
17+
18+
func GofmtNotExtra(bar string, baz string) {
19+
fmt.Print(bar, baz)
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//golangcitest:args -Egofumpt
2+
//golangcitest:config_path testdata/gofumpt-fix.yml
3+
//golangcitest:expected_exitcode 0
4+
package p
5+
6+
/*
7+
#include <stdio.h>
8+
#include <stdlib.h>
9+
10+
void myprint(char* s) {
11+
printf("%d\n", s);
12+
}
13+
*/
14+
import "C"
15+
16+
import "fmt"
17+
18+
func GofmtNotExtra(bar, baz string) {
19+
fmt.Print(bar, baz)
20+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//golangcitest:args -Egoimports
2+
//golangcitest:expected_exitcode 0
3+
package p
4+
5+
/*
6+
#include <stdio.h>
7+
#include <stdlib.h>
8+
9+
void myprint(char* s) {
10+
printf("%d\n", s);
11+
}
12+
*/
13+
import "C"
14+
15+
import (
16+
"os"
17+
"fmt"
18+
)
19+
20+
func goimports(a, b int) int {
21+
if a != b {
22+
return 1
23+
}
24+
return 2
25+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//golangcitest:args -Egoimports
2+
//golangcitest:expected_exitcode 0
3+
package p
4+
5+
/*
6+
#include <stdio.h>
7+
#include <stdlib.h>
8+
9+
void myprint(char* s) {
10+
printf("%d\n", s);
11+
}
12+
*/
13+
import "C"
14+
15+
func goimports(a, b int) int {
16+
if a != b {
17+
return 1
18+
}
19+
return 2
20+
}

0 commit comments

Comments
 (0)