From 137c05e802d5e11a5ab54809bc8be8f61ccece21 Mon Sep 17 00:00:00 2001 From: lhchavez Date: Sat, 5 Dec 2020 07:23:44 -0800 Subject: Mark some symbols to be deprecated #minor (#698) This change introduces the file deprecated.go, which contains any constants, functions, and types that are slated to be deprecated in the next major release. These symbols are deprecated because they refer to old spellings in pre-1.0 libgit2. This also makes the build be done with the `-DDEPRECATE_HARD` flag to avoid regressions. This, together with [gorelease](https://godoc.org/golang.org/x/exp/cmd/gorelease)[1] should make releases safer going forward. 1: More information about how that works at https://go.googlesource.com/exp/+/refs/heads/master/apidiff/README.md --- errorcode_string.go | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 errorcode_string.go (limited to 'errorcode_string.go') diff --git a/errorcode_string.go b/errorcode_string.go new file mode 100644 index 0000000..97160a8 --- /dev/null +++ b/errorcode_string.go @@ -0,0 +1,69 @@ +// Code generated by "stringer -type ErrorCode -trimprefix ErrorCode -tags static"; DO NOT EDIT. + +package git + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[ErrorCodeOK-0] + _ = x[ErrorCodeGeneric - -1] + _ = x[ErrorCodeNotFound - -3] + _ = x[ErrorCodeExists - -4] + _ = x[ErrorCodeAmbiguous - -5] + _ = x[ErrorCodeBuffs - -6] + _ = x[ErrorCodeUser - -7] + _ = x[ErrorCodeBareRepo - -8] + _ = x[ErrorCodeUnbornBranch - -9] + _ = x[ErrorCodeUnmerged - -10] + _ = x[ErrorCodeNonFastForward - -11] + _ = x[ErrorCodeInvalidSpec - -12] + _ = x[ErrorCodeConflict - -13] + _ = x[ErrorCodeLocked - -14] + _ = x[ErrorCodeModified - -15] + _ = x[ErrorCodeAuth - -16] + _ = x[ErrorCodeCertificate - -17] + _ = x[ErrorCodeApplied - -18] + _ = x[ErrorCodePeel - -19] + _ = x[ErrorCodeEOF - -20] + _ = x[ErrorCodeInvalid - -21] + _ = x[ErrorCodeUncommitted - -22] + _ = x[ErrorCodeDirectory - -23] + _ = x[ErrorCodeMergeConflict - -24] + _ = x[ErrorCodePassthrough - -30] + _ = x[ErrorCodeIterOver - -31] + _ = x[ErrorCodeRetry - -32] + _ = x[ErrorCodeMismatch - -33] + _ = x[ErrorCodeIndexDirty - -34] + _ = x[ErrorCodeApplyFail - -35] +} + +const ( + _ErrorCode_name_0 = "ApplyFailIndexDirtyMismatchRetryIterOverPassthrough" + _ErrorCode_name_1 = "MergeConflictDirectoryUncommittedInvalidEOFPeelAppliedCertificateAuthModifiedLockedConflictInvalidSpecNonFastForwardUnmergedUnbornBranchBareRepoUserBuffsAmbiguousExistsNotFound" + _ErrorCode_name_2 = "GenericOK" +) + +var ( + _ErrorCode_index_0 = [...]uint8{0, 9, 19, 27, 32, 40, 51} + _ErrorCode_index_1 = [...]uint8{0, 13, 22, 33, 40, 43, 47, 54, 65, 69, 77, 83, 91, 102, 116, 124, 136, 144, 148, 153, 162, 168, 176} + _ErrorCode_index_2 = [...]uint8{0, 7, 9} +) + +func (i ErrorCode) String() string { + switch { + case -35 <= i && i <= -30: + i -= -35 + return _ErrorCode_name_0[_ErrorCode_index_0[i]:_ErrorCode_index_0[i+1]] + case -24 <= i && i <= -3: + i -= -24 + return _ErrorCode_name_1[_ErrorCode_index_1[i]:_ErrorCode_index_1[i+1]] + case -1 <= i && i <= 0: + i -= -1 + return _ErrorCode_name_2[_ErrorCode_index_2[i]:_ErrorCode_index_2[i+1]] + default: + return "ErrorCode(" + strconv.FormatInt(int64(i), 10) + ")" + } +} -- cgit v1.2.3