/usr/share/gocode/src/github.com/paulbellamy/ratecounter/counter.go is in golang-github-paulbellamy-ratecounter-dev 0.0~git20151119.0.5a11f58-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 | package ratecounter
import "sync/atomic"
// A Counter is a thread-safe counter implementation
type Counter int64
// Increment the counter by some value
func (c *Counter) Incr(val int64) {
atomic.AddInt64((*int64)(c), val)
}
// Return the counter's current value
func (c *Counter) Value() int64 {
return atomic.LoadInt64((*int64)(c))
}
|