Black Lives Matter. Support the Equal Justice Initiative.

Source file src/go/types/types_test.go

Documentation: go/types

     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 types
     6  
     7  import "sync/atomic"
     8  
     9  // Upon calling ResetId, nextId starts with 1 again.
    10  // It may be called concurrently. This is only needed
    11  // for tests where we may want to have a consistent
    12  // numbering for each individual test case.
    13  func ResetId() { atomic.StoreUint32(&lastId, 0) }
    14  
    15  // SetGoVersion sets the unexported goVersion field on config, so that tests
    16  // which assert on behavior for older Go versions can set it.
    17  func SetGoVersion(config *Config, goVersion string) {
    18  	config.goVersion = goVersion
    19  }
    20  

View as plain text