mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-26 18:44:47 +01:00
When imported, the vc files carried in the 'full style' apache license text, but the standard for kata is to use SPDX style. Update the relevant files to SPDX. Fixes: #227 Signed-off-by: Graham whaley <graham.whaley@intel.com>
29 lines
551 B
Go
29 lines
551 B
Go
// Copyright (c) 2017 Intel Corporation
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
package vcmock
|
|
|
|
import (
|
|
"runtime"
|
|
"strings"
|
|
)
|
|
|
|
// getSelf returns the name of the _calling_ function
|
|
func getSelf() string {
|
|
pc := make([]uintptr, 1)
|
|
|
|
// return the program counter for the calling function
|
|
runtime.Callers(2, pc)
|
|
|
|
f := runtime.FuncForPC(pc[0])
|
|
return f.Name()
|
|
}
|
|
|
|
// IsMockError returns true if the specified error was generated by this
|
|
// package.
|
|
func IsMockError(err error) bool {
|
|
return strings.HasPrefix(err.Error(), mockErrorPrefix)
|
|
}
|