all: gofmt -w -r 'interface{} -> any' .

Updates #9687
This commit is contained in:
Bjørn Erik Pedersen
2022-03-17 22:03:27 +01:00
parent 423594e03a
commit b80853de90
342 changed files with 2118 additions and 2102 deletions

View File

@@ -30,7 +30,7 @@ type Cache struct {
}
type cacheEntry struct {
value interface{}
value any
err error
}
@@ -55,7 +55,7 @@ func (c *Cache) Clear() {
// create will be called and cached.
// This method is thread safe. It also guarantees that the create func for a given
// key is invoked only once for this cache.
func (c *Cache) GetOrCreate(key string, create func() (interface{}, error)) (interface{}, error) {
func (c *Cache) GetOrCreate(key string, create func() (any, error)) (any, error) {
c.mu.RLock()
entry, found := c.cache[key]
c.mu.RUnlock()

View File

@@ -28,7 +28,7 @@ func TestNamedCache(t *testing.T) {
cache := New()
counter := 0
create := func() (interface{}, error) {
create := func() (any, error) {
counter++
return counter, nil
}
@@ -58,8 +58,8 @@ func TestNamedCacheConcurrent(t *testing.T) {
cache := New()
create := func(i int) func() (interface{}, error) {
return func() (interface{}, error) {
create := func(i int) func() (any, error) {
return func() (any, error) {
return i, nil
}
}