github.com/zhongdalu/gf@v1.0.0/g/util/gutil/gutil_z_bench_test.go (about)

     1  // Copyright 2018 gf Author(https://github.com/zhongdalu/gf). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/zhongdalu/gf.
     6  
     7  // go test *.go -bench=".*" -benchmem
     8  
     9  package gutil
    10  
    11  import (
    12  	"testing"
    13  )
    14  
    15  func Benchmark_TryCatch(b *testing.B) {
    16  	for i := 0; i < b.N; i++ {
    17  		TryCatch(func() {
    18  
    19  		}, func(err interface{}) {
    20  
    21  		})
    22  	}
    23  }