bits_errors_bootstrap.go 621 B

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