github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/link/internal/ld/util.go (about) 1 // Copyright 2015 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 ld 6 7 import ( 8 "github.com/shogo82148/std/cmd/link/internal/loader" 9 ) 10 11 func AtExit(f func()) 12 13 // Exit exits with code after executing all atExitFuncs. 14 func Exit(code int) 15 16 // Exitf logs an error message then calls Exit(2). 17 func Exitf(format string, a ...interface{}) 18 19 // Errorf logs an error message. 20 // 21 // If more than 20 errors have been printed, exit with an error. 22 // 23 // Logging an error means that on exit cmd/link will delete any 24 // output file and return a non-zero error code. 25 // 26 // TODO: remove. Use ctxt.Errorf instead. 27 // All remaining calls use nil as first arg. 28 func Errorf(dummy *int, format string, args ...interface{}) 29 30 // Errorf method logs an error message. 31 // 32 // If more than 20 errors have been printed, exit with an error. 33 // 34 // Logging an error means that on exit cmd/link will delete any 35 // output file and return a non-zero error code. 36 func (ctxt *Link) Errorf(s loader.Sym, format string, args ...interface{})