aboutsummaryrefslogtreecommitdiff
path: root/lib/test/example_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-07-25 01:54:57 +0700
committerShulhan <ms@kilabit.info>2022-07-25 01:54:57 +0700
commit6c72cd80c30f62885809ac874e9869fdb0a1aaaa (patch)
tree7dec5f53e306a565d995cb330b42a2ede1817726 /lib/test/example_test.go
parenteb932c941bd3456f5b0635641274853e062916e7 (diff)
downloadpakakeh.go-6c72cd80c30f62885809ac874e9869fdb0a1aaaa.tar.xz
lib/test: truncate the last new line at the end of input and output
Given the following input and output, >>> input <<< output EOF The input and output content always have new line at the end. This may cause unexpected input or output. If input or output content expecting new line at the end, add two empty lines at the end of it.
Diffstat (limited to 'lib/test/example_test.go')
-rw-r--r--lib/test/example_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/test/example_test.go b/lib/test/example_test.go
index e14d123e..4016fa8b 100644
--- a/lib/test/example_test.go
+++ b/lib/test/example_test.go
@@ -29,11 +29,11 @@ func ExampleLoadDataDir() {
fmt.Printf(" Desc=%s\n", data.Desc)
fmt.Println(" Input")
for name, content = range data.Input {
- fmt.Printf(" %s=%s", name, content)
+ fmt.Printf(" %s=%s\n", name, content)
}
fmt.Println(" Output")
for name, content = range data.Output {
- fmt.Printf(" %s=%s", name, content)
+ fmt.Printf(" %s=%s\n", name, content)
}
}
@@ -82,11 +82,11 @@ func ExampleLoadData() {
fmt.Printf(" Desc=%s\n", data.Desc)
fmt.Println(" Input")
for name, content = range data.Input {
- fmt.Printf(" %s=%s", name, content)
+ fmt.Printf(" %s=%s\n", name, content)
}
fmt.Println(" Output")
for name, content = range data.Output {
- fmt.Printf(" %s=%s", name, content)
+ fmt.Printf(" %s=%s\n", name, content)
}
// Output: