diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 13:16:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 13:16:40 +0000 |
commit | 47ab3d4a42e9ab51c465c4322d2ec233f6324e6b (patch) | |
tree | a61a0ffd83f4a3def4b36e5c8e99630c559aa723 /test/fixedbugs/issue4326.dir | |
parent | Initial commit. (diff) | |
download | golang-1.18-47ab3d4a42e9ab51c465c4322d2ec233f6324e6b.tar.xz golang-1.18-47ab3d4a42e9ab51c465c4322d2ec233f6324e6b.zip |
Adding upstream version 1.18.10.upstream/1.18.10upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/fixedbugs/issue4326.dir')
-rw-r--r-- | test/fixedbugs/issue4326.dir/p1.go | 12 | ||||
-rw-r--r-- | test/fixedbugs/issue4326.dir/p2.go | 5 | ||||
-rw-r--r-- | test/fixedbugs/issue4326.dir/q1.go | 8 | ||||
-rw-r--r-- | test/fixedbugs/issue4326.dir/q2.go | 11 | ||||
-rw-r--r-- | test/fixedbugs/issue4326.dir/z.go | 7 |
5 files changed, 43 insertions, 0 deletions
diff --git a/test/fixedbugs/issue4326.dir/p1.go b/test/fixedbugs/issue4326.dir/p1.go new file mode 100644 index 0000000..ab214be --- /dev/null +++ b/test/fixedbugs/issue4326.dir/p1.go @@ -0,0 +1,12 @@ +package p1 + +type O map[string]map[string]string + +func (opts O) RemoveOption(sect, opt string) bool { + if _, ok := opts[sect]; !ok { + return false + } + _, ok := opts[sect][opt] + delete(opts[sect], opt) + return ok +} diff --git a/test/fixedbugs/issue4326.dir/p2.go b/test/fixedbugs/issue4326.dir/p2.go new file mode 100644 index 0000000..8e86266 --- /dev/null +++ b/test/fixedbugs/issue4326.dir/p2.go @@ -0,0 +1,5 @@ +package p2 + +import "./p1" + +func NewO() p1.O { return nil } diff --git a/test/fixedbugs/issue4326.dir/q1.go b/test/fixedbugs/issue4326.dir/q1.go new file mode 100644 index 0000000..f118eb0 --- /dev/null +++ b/test/fixedbugs/issue4326.dir/q1.go @@ -0,0 +1,8 @@ +package q1 + +func Deref(typ interface{}) interface{} { + if typ, ok := typ.(*int); ok { + return *typ + } + return typ +} diff --git a/test/fixedbugs/issue4326.dir/q2.go b/test/fixedbugs/issue4326.dir/q2.go new file mode 100644 index 0000000..075e2b2 --- /dev/null +++ b/test/fixedbugs/issue4326.dir/q2.go @@ -0,0 +1,11 @@ +package main + +import "./q1" + +func main() { + x := 1 + y := q1.Deref(&x) + if y != 1 { + panic("y != 1") + } +} diff --git a/test/fixedbugs/issue4326.dir/z.go b/test/fixedbugs/issue4326.dir/z.go new file mode 100644 index 0000000..9b222e8 --- /dev/null +++ b/test/fixedbugs/issue4326.dir/z.go @@ -0,0 +1,7 @@ +package z + +import "./p2" + +func main() { + p2.NewO().RemoveOption("hello", "world") +} |