Source file test/typeparam/stringerimp.dir/a.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  
     5  package a
     6  
     7  type Stringer interface {
     8  	String() string
     9  }
    10  
    11  func Stringify[T Stringer](s []T) (ret []string) {
    12  	for _, v := range s {
    13  		ret = append(ret, v.String())
    14  	}
    15  	return ret
    16  }
    17  

View as plain text