Skip to content

Commit 17e2836

Browse files
committed
hello/reverse: add example example test
This will be linked from an updated go.dev/blog/examples. For #61722. Change-Id: I329141141e0590a6d7ee0b6b504c8f7bdc9c2d5f Reviewed-on: https://go-review.googlesource.com/c/example/+/515237 TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Russ Cox <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
1 parent 19299f6 commit 17e2836

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

hello/reverse/example_test.go

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2023 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package reverse_test
6+
7+
import (
8+
"fmt"
9+
10+
"golang.org/x/example/hello/reverse"
11+
)
12+
13+
func ExampleString() {
14+
fmt.Println(reverse.String("hello"))
15+
// Output: olleh
16+
}

0 commit comments

Comments
 (0)