github.com/zhongdalu/gf@v1.0.0/g/net/ghttp/ghttp_unit_init_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  // 测试初始化
     8  package ghttp_test
     9  
    10  import (
    11  	"github.com/zhongdalu/gf/g/container/garray"
    12  )
    13  
    14  var (
    15  	// 用于测试的端口数组,随机获取
    16  	ports = garray.NewIntArray()
    17  )
    18  
    19  func init() {
    20  	for i := 8000; i <= 9000; i++ {
    21  		ports.Append(i)
    22  	}
    23  }