mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2024-12-29 12:17:48 +00:00
d55639e713
Package set provides simple set data structures for uint64 and string types. High-level API: type Set(T {}) xxx func (Set) Len() int func (Set) Has(T) bool func (Set) Set(T) func (Set) Clear(T) These data structures are useful for implementing required fields efficiently or ensuring that protobuf identifiers do not conflict. Change-Id: If846630a9034909a43121b3e0f6720275f4b7aaf Reviewed-on: https://go-review.googlesource.com/128898 Reviewed-by: Chris Manghane <cmang@golang.org>
22 lines
601 B
Go
22 lines
601 B
Go
// 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.
|
|
|
|
// Package set provides simple set data structures for uint64 and string types.
|
|
//
|
|
// The API for every set is:
|
|
// type Set(T {}) opaque
|
|
//
|
|
// // Len reports the number of elements in the set.
|
|
// func (Set) Len() int
|
|
//
|
|
// // Has reports whether an item is in the set.
|
|
// func (Set) Has(T) bool
|
|
//
|
|
// // Set inserts the item into the set.
|
|
// func (Set) Set(T)
|
|
//
|
|
// // Clear removes the item from the set.
|
|
// func (Set) Clear(T)
|
|
package set
|