Skip to content

Commit 88bcabe

Browse files
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
1 parent 02a3cfb commit 88bcabe

File tree

6 files changed

+29
-15
lines changed

6 files changed

+29
-15
lines changed

internal/msgtransfer/online_history_msg_handler.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ func (och *OnlineHistoryRedisConsumerHandler) toPushTopic(
257257
msgs []*sdkws.MsgData,
258258
) {
259259
for _, v := range msgs {
260-
och.msgDatabase.MsgToPushMQ(ctx, key, conversationID, v)
260+
och.msgDatabase.MsgToPushMQ(ctx, key, conversationID, v) // nolint: errcheck
261+
261262
}
262263
}
263264

internal/push/offlinepush/fcm/push.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ func (f *Fcm) Push(ctx context.Context, userIDs []string, title, content string,
127127
response, err := f.fcmMsgCli.SendAll(ctx, messages)
128128
if err != nil {
129129
Fail = Fail + messageCount
130-
// log.Info(operationID, "some token push err", err.Error(), messageCount)
131130
} else {
132131
Success = Success + response.SuccessCount
133132
Fail = Fail + response.FailureCount

pkg/common/discoveryregister/kubernetes/kubernetes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,5 +194,5 @@ func (cli *K8sDR) GetClientLocalConns() map[string][]*grpc.ClientConn {
194194
return nil
195195
}
196196
func (cli *K8sDR) Close() {
197-
return
197+
198198
}

pkg/common/kafka/producer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func configureProducerAck(p *Producer, ackConfig string) {
118118

119119
// configureCompression configures the message compression type for the producer.
120120
func configureCompression(p *Producer, compressType string) {
121-
var compress sarama.CompressionCodec = sarama.CompressionNone
121+
var compress = sarama.CompressionNone
122122
err := compress.UnmarshalText(bytes.ToLower([]byte(compressType)))
123123
if err != nil {
124124
fmt.Printf("Failed to configure compression: %v\n", err)

test/e2e/api/token/token.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ type UserRegisterRequest struct {
5757
Users []User `json:"users"`
5858
}
5959

60+
/* func main() {
61+
// Example usage of functions
62+
token, err := GetUserToken("openIM123456")
63+
if err != nil {
64+
log.Fatalf("Error getting user token: %v", err)
65+
}
66+
fmt.Println("Token:", token)
67+
68+
err = RegisterUser(token, "testUserID", "TestNickname", "https://example.com/image.jpg")
69+
if err != nil {
70+
log.Fatalf("Error registering user: %v", err)
71+
}
72+
} */
73+
6074
// GetUserToken requests a user token from the API.
6175
func GetUserToken(userID string) (string, error) {
6276
reqBody := UserTokenRequest{

test/e2e/framework/helpers/chat/chat.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,23 +101,23 @@ func main() {
101101
select {}
102102
}
103103

104-
// // getLatestVersion fetches the latest version number from a given URL.
105-
// func getLatestVersion(url string) (string, error) {
106-
// resp, err := http.Get(url)
107-
// if err != nil {
108-
// return "", err
109-
// }
110-
// defer resp.Body.Close()
104+
// getLatestVersion fetches the latest version number from a given URL.
105+
/* func getLatestVersion(url string) (string, error) {
106+
resp, err := http.Get(url)
107+
if err != nil {
108+
return "", err
109+
}
110+
defer resp.Body.Close()
111111
112112
// location := resp.Header.Get("Location")
113113
// if location == "" {
114114
// return defaultTemplateVersion, nil
115115
// }
116116
117-
// // Extract the version number from the URL
118-
// latestVersion := filepath.Base(location)
119-
// return latestVersion, nil
120-
// }
117+
// Extract the version number from the URL
118+
latestVersion := filepath.Base(location)
119+
return latestVersion, nil
120+
} */
121121

122122
// downloadAndExtract downloads a file from a URL and extracts it to a destination directory.
123123
func downloadAndExtract(url, destDir string) error {

0 commit comments

Comments
 (0)