GoPLS Viewer

Home|gopls/go/callgraph/vta/internal/trie/scope.go
1// Copyright 2021 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package trie
6
7import (
8    "strconv"
9    "sync/atomic"
10)
11
12// Scope represents a distinct collection of maps.
13// Maps with the same Scope can be equal. Maps in different scopes are distinct.
14// Each Builder creates maps within a unique Scope.
15type Scope struct {
16    id int32
17}
18
19var nextScopeId int32
20
21func newScope() Scope {
22    id := atomic.AddInt32(&nextScopeId1)
23    return Scope{idid}
24}
25
26func (s ScopeString() string {
27    return strconv.Itoa(int(s.id))
28}
29
MembersX
Scope
nextScopeId
newScope
newScope.id
Scope.String.s
Scope.String
strconv
Scope.id
atomic
Members
X