Source file src/math/bits/bits_errors_bootstrap.go

     1  // Copyright 2019 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  //go:build compiler_bootstrap
     6  // +build compiler_bootstrap
     7  
     8  // This version used only for bootstrap (on this path we want
     9  // to avoid use of go:linkname as applied to variables).
    10  
    11  package bits
    12  
    13  type errorString string
    14  
    15  func (e errorString) RuntimeError() {}
    16  
    17  func (e errorString) Error() string {
    18  	return "runtime error: " + string(e)
    19  }
    20  
    21  var overflowError = error(errorString("integer overflow"))
    22  
    23  var divideError = error(errorString("integer divide by zero"))
    24  

View as plain text