Skip to content

Commit 37f1a41

Browse files
authored
Update README.md
1 parent 1187b09 commit 37f1a41

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ytest/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ json {
4747

4848
The directive `testServer` creates the web server by [net/http/httptest](https://pkg.go.dev/net/http/httptest#NewServer) and obtained a random port as the service address. Then it calls the directive [host](https://pkg.go.dev/github.com/goplus/yap/ytest#App.Host) to map the random service address to `foo.com`. This makes all other code no need to changed.
4949

50-
## yaptest User Manual
5150

5251
### match
5352

@@ -61,7 +60,7 @@ match id, 1+2
6160
echo id
6261
```
6362

64-
Here we define a variable called `id` and match it with expression `1+2`. If the variable is unbound, it is assigned the value of the expression.
63+
Here we define a variable called `id` and match it with expression `1+2`. If the variable is unbound, it is assigned the value of the expression. In this way the value of `id` becomes `3`.
6564

6665
So far, you've seen `match` like the assignment side. But you cannot assign a different value to a variable that has been bound:
6766

@@ -74,7 +73,7 @@ echo id
7473
match id, 5 // unmatched value - expected: 3, got: 5
7574
```
7675

77-
In the second match statement, the variable `id` has been bound. At this time, it will be compared with the expression value. If it is equal, it will succeed, otherwise an error will be reported (such as the third match statement above).
76+
In the second `match` statement, the variable `id` has been bound. At this time, it will be compared with the expression value. If it is equal, it will succeed, otherwise an error will be reported (such as the third `match` statement above).
7877

7978
The `match` statement [can be complex](demo/match/complex/complex_yap.gox), such as:
8079

0 commit comments

Comments
 (0)