summaryrefslogtreecommitdiff
path: root/src/mongo/gotools/vendor/src/github.com/3rf/mongo-lint/testdata/inc.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/gotools/vendor/src/github.com/3rf/mongo-lint/testdata/inc.go')
-rw-r--r--src/mongo/gotools/vendor/src/github.com/3rf/mongo-lint/testdata/inc.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/gotools/vendor/src/github.com/3rf/mongo-lint/testdata/inc.go b/src/mongo/gotools/vendor/src/github.com/3rf/mongo-lint/testdata/inc.go
new file mode 100644
index 00000000000..3868beea116
--- /dev/null
+++ b/src/mongo/gotools/vendor/src/github.com/3rf/mongo-lint/testdata/inc.go
@@ -0,0 +1,14 @@
+// Test for use of x++ and x--.
+
+// Package pkg ...
+package pkg
+
+func addOne(x int) int {
+ x += 1 // MATCH /x\+\+/
+ return x
+}
+
+func subOneInLoop(y int) {
+ for ; y > 0; y -= 1 { // MATCH /y--/
+ }
+}