chore: fix lint issues
This commit is contained in:
parent
17ea21a579
commit
7c37953c28
20 changed files with 136 additions and 131 deletions
|
@ -28,7 +28,7 @@ type CreateChannelMappingRequest struct {
|
|||
}
|
||||
|
||||
// Validate checks if all required fields are present and valid
|
||||
func (r CreateChannelMappingRequest) Validate() error {
|
||||
func (r *CreateChannelMappingRequest) Validate() error {
|
||||
if r.ChannelID == "" {
|
||||
return fmt.Errorf("channelID cannot be empty")
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ type BridgeManager interface {
|
|||
OnPluginConfigurationChange(config *config.Configuration) error
|
||||
|
||||
// CreateChannelMapping is called when a channel mapping is created.
|
||||
CreateChannelMapping(req CreateChannelMappingRequest) error
|
||||
CreateChannelMapping(req *CreateChannelMappingRequest) error
|
||||
|
||||
// DeleteChannepMapping is called when a channel mapping is deleted.
|
||||
DeleteChannepMapping(req DeleteChannelMappingRequest) error
|
||||
|
|
|
@ -15,11 +15,11 @@ const (
|
|||
// BridgeMessage represents a message that can be passed between any bridge types
|
||||
type BridgeMessage struct {
|
||||
// Source information
|
||||
SourceBridge string // "xmpp", "mattermost", "slack", etc.
|
||||
SourceChannelID string // Channel ID in source system
|
||||
SourceUserID string // User ID in source system (JID, user ID, etc.)
|
||||
SourceUserName string // Display name in source system
|
||||
SourceRemoteID string // Remote ID of the bridge instance that created this message
|
||||
SourceBridge string // "xmpp", "mattermost", "slack", etc.
|
||||
SourceChannelID string // Channel ID in source system
|
||||
SourceUserID string // User ID in source system (JID, user ID, etc.)
|
||||
SourceUserName string // Display name in source system
|
||||
SourceRemoteID string // Remote ID of the bridge instance that created this message
|
||||
|
||||
// Message content (standardized on Markdown)
|
||||
Content string // Markdown formatted message content
|
||||
|
|
|
@ -22,12 +22,12 @@ func SanitizeShareName(name string) string {
|
|||
}
|
||||
|
||||
// Ensure it starts with alphanumeric
|
||||
for len(result) > 0 && (result[0] == '-' || result[0] == '_') {
|
||||
for result != "" && (result[0] == '-' || result[0] == '_') {
|
||||
result = result[1:]
|
||||
}
|
||||
|
||||
// Ensure it ends with alphanumeric
|
||||
for len(result) > 0 && (result[len(result)-1] == '-' || result[len(result)-1] == '_') {
|
||||
for result != "" && (result[len(result)-1] == '-' || result[len(result)-1] == '_') {
|
||||
result = result[:len(result)-1]
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue