/usr/share/gocode/src/github.com/cenk/rpc2/state.go is in golang-github-cenk-rpc2-dev 0.0~git20160427.0.7ab76d2e88c7-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | package rpc2
import "sync"
type State struct {
store map[string]interface{}
m sync.RWMutex
}
func NewState() *State {
return &State{store: make(map[string]interface{})}
}
func (s *State) Get(key string) (value interface{}, ok bool) {
s.m.RLock()
value, ok = s.store[key]
s.m.RUnlock()
return
}
func (s *State) Set(key string, value interface{}) {
s.m.Lock()
s.store[key] = value
s.m.Unlock()
}
|