Please provide as much information as possible, usually I need these information to actually start working on an issue, so try to fill as much of these as possible
Sample code
package transport
import "net/http"
const (
success = "success"
failure = "failure"
badRequest = "bad_request"
accessDenied = "access_denied"
unexpectedError = "unexpected_error"
)
var ipcStatusMapping = map[int]string{
401: accessDenied,
400: badRequest,
}
func StatusToIPCStatus(status int) string {
if status == http.StatusServiceUnavailable {
return StatusToIPCStatusDetail(http.StatusTooManyRequests)
}
return StatusToIPCStatusDetail(status)
}
func StatusToIPCStatusDetail(statusCode int) string {
if ipcst, ok := ipcStatusMapping[statusCode]; ok {
return ipcst
}
switch statusCode / 100 {
case 2, 3:
return success
case 4:
return badRequest
default:
return unexpectedError
}
}
Please provide as much information as possible, usually I need these information to actually start working on an issue, so try to fill as much of these as possible
Sample code
Filename and Language selected
.go and Golang
VSCode 1.85.2
VSCode 1.86.1
Versions used
Extra information
settings.json