From 27c2a03ea8b66024d63fcb82bf301365a54768d1 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 10 Jun 2020 23:07:07 +0800 Subject: [PATCH] add example for package gset --- container/gset/gset_z_example_int_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 container/gset/gset_z_example_int_test.go diff --git a/container/gset/gset_z_example_int_test.go b/container/gset/gset_z_example_int_test.go new file mode 100644 index 000000000..cc14b4ec8 --- /dev/null +++ b/container/gset/gset_z_example_int_test.go @@ -0,0 +1,23 @@ +// Copyright 2020 gf Author(https://github.com/gogf/gf). All Rights Reserved. +// +// This Source Code Form is subject to the terms of the MIT License. +// If a copy of the MIT was not distributed with gm file, +// You can obtain one at https://github.com/gogf/gf. + +package gset_test + +import ( + "fmt" + "github.com/gogf/gf/container/gset" +) + +func ExampleIntSet_Contains() { + var set gset.IntSet + set.Add(1) + fmt.Println(set.Contains(1)) + fmt.Println(set.Contains(2)) + + // Output: + // true + // false +}