mirror of
https://github.com/usememos/memos.git
synced 2024-11-10 17:02:21 +08:00
chore: tweak linter
This commit is contained in:
parent
3e6e56b008
commit
3088cabe10
1 changed files with 3 additions and 6 deletions
|
@ -63,8 +63,7 @@ func (s *Store) CreateStorageV1(ctx context.Context, create *storepb.Storage) (*
|
|||
Type: create.Type.String(),
|
||||
}
|
||||
|
||||
switch create.Type {
|
||||
case storepb.Storage_S3:
|
||||
if create.Type == storepb.Storage_S3 {
|
||||
configBytes, err := proto.Marshal(create.Config.GetS3Config())
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to marshal s3 config")
|
||||
|
@ -160,8 +159,7 @@ func convertStorageFromRaw(storageRaw *Storage) (*storepb.Storage, error) {
|
|||
|
||||
func convertStorageConfigFromRaw(storageType storepb.Storage_Type, configRaw string) (*storepb.StorageConfig, error) {
|
||||
storageConfig := &storepb.StorageConfig{}
|
||||
switch storageType {
|
||||
case storepb.Storage_S3:
|
||||
if storageType == storepb.Storage_S3 {
|
||||
s3Config := &storepb.S3Config{}
|
||||
err := proto.Unmarshal([]byte(configRaw), s3Config)
|
||||
if err != nil {
|
||||
|
@ -174,8 +172,7 @@ func convertStorageConfigFromRaw(storageType storepb.Storage_Type, configRaw str
|
|||
|
||||
func convertStorageConfigToRaw(storageType storepb.Storage_Type, config *storepb.StorageConfig) (string, error) {
|
||||
raw := ""
|
||||
switch storageType {
|
||||
case storepb.Storage_S3:
|
||||
if storageType == storepb.Storage_S3 {
|
||||
bytes, err := proto.Marshal(config.GetS3Config())
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
Loading…
Reference in a new issue