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

View as plain text