diff --git a/modules/docker/docker_api.go b/modules/docker/docker_api.go index da67442813..249a33db1b 100644 --- a/modules/docker/docker_api.go +++ b/modules/docker/docker_api.go @@ -217,7 +217,7 @@ func GetMappedPort(ctx context.Context, containerName string, port string) (uint } } } - return 0, fmt.Errorf("容器未开放端口" + port) + return 0, fmt.Errorf("容器未开放端口 %s", port) } func ExecCommandInContainer(ctx context.Context, cli *client.Client, containerName string, command string) (string, error) { containerID, err := GetContainerID(cli, containerName) diff --git a/services/devcontainer/devcontainer_utils.go b/services/devcontainer/devcontainer_utils.go index b3643d6679..71d4f4317d 100644 --- a/services/devcontainer/devcontainer_utils.go +++ b/services/devcontainer/devcontainer_utils.go @@ -96,13 +96,13 @@ func GetFileContentByPath(ctx context.Context, repo *repo.Repository, path strin // No way to edit a directory online. if entry.IsDir() { - return "", fmt.Errorf(path + " entry.IsDir") + return "", fmt.Errorf("%s entry.IsDir", path) } blob := entry.Blob() if blob.Size() >= setting.UI.MaxDisplayFileSize { - return "", fmt.Errorf(path + " blob.Size overflow") + return "", fmt.Errorf("%s blob.Size overflow", path) } dataRc, err := blob.DataAsync()