.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.1.1-0.20210319172145-bda8f5cee399 / cmd / stringer / testdata / vary_day.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.1.1-0.20210319172145-bda8f5cee399/cmd/stringer/testdata/vary_day.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.1.1-0.20210319172145-bda8f5cee399/cmd/stringer/testdata/vary_day.go
new file mode 100644 (file)
index 0000000..763cf36
--- /dev/null
@@ -0,0 +1,39 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// This file is the same as day.go except the constants have different values.
+
+package main
+
+import "fmt"
+
+type Day int
+
+const (
+       Sunday Day = iota
+       Monday
+       Tuesday
+       Wednesday
+       Thursday
+       Friday
+       Saturday
+)
+
+func main() {
+       ck(Monday, "Monday")
+       ck(Tuesday, "Tuesday")
+       ck(Wednesday, "Wednesday")
+       ck(Thursday, "Thursday")
+       ck(Friday, "Friday")
+       ck(Saturday, "Saturday")
+       ck(Sunday, "Sunday")
+       ck(-127, "Day(-127)")
+       ck(127, "Day(127)")
+}
+
+func ck(day Day, str string) {
+       if fmt.Sprint(day) != str {
+               panic("day.go: " + str)
+       }
+}