github.com/go4org/go4@v0.0.0-20200104003542-c7e774b10ea0/reflectutil/swapper_std.go (about)

     1  // Copyright 2018 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  // +build go1.8
     6  
     7  package reflectutil
     8  
     9  import "reflect"
    10  
    11  func swapper(slice reflect.Value) func(i, j int) {
    12  	return reflect.Swapper(slice.Interface())
    13  }