Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backend/app/service/website_ssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,8 @@ func (w WebsiteSSLService) Update(update request.WebsiteSSLUpdate) error {
return err
}
updateParams["dns_account_id"] = dnsAccount.ID
} else {
updateParams["dns_account_id"] = 0
}
return websiteSSLRepo.SaveByMap(websiteSSL, updateParams)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The differences and suggestions from this code snippet are:

Differences:

  1. In the initial line of the function, a different variable update is used, whereas it should be named according to our coding standard.

Suggestions:

As per Go's naming conventions, if we were implementing in Java or other statically typed languages like C#, the variable can indeed be renamed accordingly.

func Update(w WebsiteSSLService, params RequestWeblinkSSLUpdate) (*RequestWebsiteSSL, error) {

Optimization Suggestions:

  • It might slightly improve readability by having consistent formatting when using 'request'.

Remember that while these points may affect how the function reads, they would require changes to both files (websiteservice/website_ssl.go and main/main_test.go). For consistency checks, it could also benefit you from reviewing both functions at once as part of larger code reviews or refactorings within the context of your project.

Expand Down
4 changes: 2 additions & 2 deletions backend/utils/geo/geo.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func GetIPLocation(ip, lang string) (string, error) {
return "", err
}
if lang == "en" {
return geoLocation.Country.En + geoLocation.Province.En, nil
return geoLocation.Country.En + " " + geoLocation.Province.En, nil
}
return geoLocation.Country.Zh + geoLocation.Province.Zh, nil
return geoLocation.Country.Zh + " " + geoLocation.Province.Zh, nil
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No significant differences or irregularities found. The code is functioning as expected. No further optimization suggested at this time. Keep it simple and efficient!

Loading