Source file test/typeparam/minimp.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 Ordered interface {
     8  	~int | ~int64 | ~float64 | ~string
     9  }
    10  
    11  func Min[T Ordered](x, y T) T {
    12  	if x < y {
    13  		return x
    14  	}
    15  	return y
    16  }
    17  

View as plain text