github.com/go-asm/go@v1.21.1-0.20240213172139-40c5ead50c48/cmd/go/cfg/bench_test.go (about)

     1  // Copyright 2023 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 cfg
     6  
     7  import (
     8  	"testing"
     9  
    10  	"github.com/go-asm/go/testenv"
    11  )
    12  
    13  func BenchmarkLookPath(b *testing.B) {
    14  	testenv.MustHaveExecPath(b, "go")
    15  	b.ResetTimer()
    16  	for i := 0; i < b.N; i++ {
    17  		_, err := LookPath("go")
    18  		if err != nil {
    19  			b.Fatal(err)
    20  		}
    21  	}
    22  }