mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-04-28 14:29:19 +08:00
feat: optimize openim make lint style format (#1995)
* feat: add openim make lint * feat: add openim make lint * feat: add openim make lint * feat: add openim make lint * feat: add openim make lint
This commit is contained in:
@@ -57,6 +57,20 @@ type UserRegisterRequest struct {
|
||||
Users []User `json:"users"`
|
||||
}
|
||||
|
||||
/* func main() {
|
||||
// Example usage of functions
|
||||
token, err := GetUserToken("openIM123456")
|
||||
if err != nil {
|
||||
log.Fatalf("Error getting user token: %v", err)
|
||||
}
|
||||
fmt.Println("Token:", token)
|
||||
|
||||
err = RegisterUser(token, "testUserID", "TestNickname", "https://example.com/image.jpg")
|
||||
if err != nil {
|
||||
log.Fatalf("Error registering user: %v", err)
|
||||
}
|
||||
} */
|
||||
|
||||
// GetUserToken requests a user token from the API.
|
||||
func GetUserToken(userID string) (string, error) {
|
||||
reqBody := UserTokenRequest{
|
||||
|
||||
@@ -101,23 +101,23 @@ func main() {
|
||||
select {}
|
||||
}
|
||||
|
||||
// // getLatestVersion fetches the latest version number from a given URL.
|
||||
// func getLatestVersion(url string) (string, error) {
|
||||
// resp, err := http.Get(url)
|
||||
// if err != nil {
|
||||
// return "", err
|
||||
// }
|
||||
// defer resp.Body.Close()
|
||||
// getLatestVersion fetches the latest version number from a given URL.
|
||||
/* func getLatestVersion(url string) (string, error) {
|
||||
resp, err := http.Get(url)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
// location := resp.Header.Get("Location")
|
||||
// if location == "" {
|
||||
// return defaultTemplateVersion, nil
|
||||
// }
|
||||
|
||||
// // Extract the version number from the URL
|
||||
// latestVersion := filepath.Base(location)
|
||||
// return latestVersion, nil
|
||||
// }
|
||||
// Extract the version number from the URL
|
||||
latestVersion := filepath.Base(location)
|
||||
return latestVersion, nil
|
||||
} */
|
||||
|
||||
// downloadAndExtract downloads a file from a URL and extracts it to a destination directory.
|
||||
func downloadAndExtract(url, destDir string) error {
|
||||
|
||||
Reference in New Issue
Block a user