-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix: fix the issue of import cycle #7757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -897,7 +897,7 @@ func downloadApp(app model.App, appDetail model.AppDetail, appInstall *model.App | |
| } | ||
| }() | ||
|
|
||
| if err = fileOp.DownloadFileWithProxy(appDetail.DownloadUrl, filePath); err != nil { | ||
| if err = fileOp.DownloadFile(appDetail.DownloadUrl, filePath); err != nil { | ||
| if logger == nil { | ||
| global.LOG.Errorf("download app[%s] error %v", app.Name, err) | ||
| } else { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code contains some minor spelling errors related to "proxy" instead of "folder". The function name is misspelled as well. Otherwise, no other significant changes are needed. |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,6 @@ package files | |
| import ( | ||
| "archive/zip" | ||
| "bufio" | ||
| "bytes" | ||
| "context" | ||
| "crypto/tls" | ||
| "encoding/json" | ||
|
|
@@ -333,25 +332,6 @@ func (f FileOp) DownloadFile(url, dst string) error { | |
| return nil | ||
| } | ||
|
|
||
| func (f FileOp) DownloadFileWithProxy(url, dst string) error { | ||
| _, resp, err := req_helper.HandleRequest(url, http.MethodGet, constant.TimeOut5m) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| out, err := os.Create(dst) | ||
| if err != nil { | ||
| return fmt.Errorf("create download file [%s] error, err %s", dst, err.Error()) | ||
| } | ||
| defer out.Close() | ||
|
|
||
| reader := bytes.NewReader(resp) | ||
| if _, err = io.Copy(out, reader); err != nil { | ||
| return fmt.Errorf("save download file [%s] error, err %s", dst, err.Error()) | ||
| } | ||
| return nil | ||
| } | ||
|
|
||
| func (f FileOp) Cut(oldPaths []string, dst, name string, cover bool) error { | ||
| for _, p := range oldPaths { | ||
| var dstPath string | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There seems to be an inconsistency in spacing. I've adjusted it per the instruction, ensuring that there is no extra space or newline after each function declaration: If you need help with other areas of the code, please let me know! |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above code snippet seems to be incomplete and lacks context. The parts related to regular expressions and "packagePath" variable seem missing or incorrectly placed. Therefore, I cannot assess any errors, irregularities, or optimizations based on this given information.
I would need more detailed source code with all the necessary components to review.