Skip to content

Commit c892b4c

Browse files
authored
Prepare release v0.1.1 (#62)
Prepare a new release of gopatch with a fix for #54. This will release a binary compiled against Go 1.18, so it will be able to parse generics syntax. Verify that we're able to parse generics syntax with two new integration tests.
1 parent 3028491 commit c892b4c

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 0.1.1 - 2022-07-26
9+
### Fixed
10+
- ([#54]) Preserve top-level comments in files when updating imports.
11+
- Parse generics syntax introduced in Go 1.18.
12+
13+
[#54]: https://github.com/uber-go/gopatch/issues/54
14+
15+
Thanks to @breml for their contribution to this release.
16+
817
## 0.1.0 - 2021-08-19
918
Starting this release, we will include pre-built binaries of gopatch for
1019
different systems.

testdata/generic_instantiation

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Test that we can parse generic function instantiation in patches.
2+
3+
-- foo_to_bar.patch --
4+
@@
5+
var T, v expression
6+
@@
7+
-foo[T](v)
8+
+bar[T](v)
9+
10+
-- a.in.go --
11+
package a
12+
13+
func baz() {
14+
foo[int](42)
15+
foo[[]byte]([]byte("hello"))
16+
foo[List[int]](nil)
17+
}
18+
19+
-- a.out.go --
20+
package a
21+
22+
func baz() {
23+
bar[int](42)
24+
bar[[]byte]([]byte("hello"))
25+
bar[List[int]](nil)
26+
}

testdata/generics_in_src

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Test that we can parse generics syntax in source files.
2+
3+
-- foo_to_bar.patch --
4+
@@
5+
@@
6+
-foo
7+
+bar
8+
9+
-- a.in.go --
10+
package a
11+
12+
import "fmt"
13+
14+
func foo[T any](x T) {
15+
fmt.Println(x)
16+
}
17+
18+
func baz() {
19+
foo[int](42)
20+
}
21+
22+
-- a.out.go --
23+
package a
24+
25+
import "fmt"
26+
27+
func bar[T any](x T) {
28+
fmt.Println(x)
29+
}
30+
31+
func baz() {
32+
bar[int](42)
33+
}
34+

0 commit comments

Comments
 (0)