Skip to content

Commit

Permalink
run gofmt
Browse files Browse the repository at this point in the history
Signed-off-by: MUzairS15 <muzair.shaikh810@gmail.com>
  • Loading branch information
MUzairS15 committed Jun 18, 2024
1 parent bb0615b commit 2a73d8f
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions models/catalog/v1alpha1/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (cd *CatalogData) IsNil() bool {
return cd == nil || (len(cd.Compatibility) == 0 &&
cd.PatternCaveats == "" &&
cd.PatternInfo == "" &&
cd.Type == "" &&
cd.Type == "" &&
cd.ContentClass.String() != "")
}

Expand Down Expand Up @@ -98,4 +98,4 @@ func GetCatalogClasses() []ContentClass {
Project,
Community,
}
}
}
5 changes: 4 additions & 1 deletion models/meshmodel/core/v1beta1/category.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ func (cat Category) Type() entity.EntityType {
}

func (cat *Category) GenerateID() (uuid.UUID, error) {
byt, err := json.Marshal(cat)
categoryIdentifier := Category{
Name: cat.Name,
}
byt, err := json.Marshal(categoryIdentifier)
if err != nil {
return uuid.UUID{}, err
}
Expand Down
2 changes: 1 addition & 1 deletion models/meshmodel/core/v1beta1/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (c ComponentDefinition) Type() entity.EntityType {
}

func (c *ComponentDefinition) GenerateID() (uuid.UUID, error) {
return uuid.New(), nil
return uuid.New(), nil
}

func (c ComponentDefinition) GetID() uuid.UUID {
Expand Down
4 changes: 2 additions & 2 deletions models/meshmodel/core/v1beta1/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ func (h *Host) GenerateID() (uuid.UUID, error) {
}

func (h *Host) Create(db *database.Handler) (uuid.UUID, error) {

hID, err := h.GenerateID()
if err != nil {
return uuid.UUID{}, err
return uuid.UUID{}, err
}
var host Host
hostCreationLock.Lock()
Expand Down
4 changes: 2 additions & 2 deletions models/meshmodel/core/v1beta1/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (m Model) Type() entity.EntityType {
return entity.Model
}

func (m *Model) GenerateID() (uuid.UUID, error) {
func (m *Model) GenerateID() (uuid.UUID, error) {
modelIdentifier := Model{
Registrant: m.Registrant,
VersionMeta: m.VersionMeta,
Expand Down Expand Up @@ -78,7 +78,7 @@ func (m *Model) Create(db *database.Handler, hostID uuid.UUID) (uuid.UUID, error
if err != nil {
return modelID, err
}

var model Model
if m.Name == "" {
return uuid.UUID{}, fmt.Errorf("empty or invalid model name passed")
Expand Down
2 changes: 1 addition & 1 deletion models/meshmodel/core/v1beta1/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (p *PolicyDefinition) GetEntityDetail() string {

func (p *PolicyDefinition) Create(db *database.Handler, hostID uuid.UUID) (uuid.UUID, error) {
p.ID, _ = p.GenerateID()

mid, err := p.Model.Create(db, hostID)
if err != nil {
return uuid.UUID{}, err
Expand Down
2 changes: 0 additions & 2 deletions models/meshmodel/registry/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ import (
)

var (

ErrUnknownHostCode = "replace_me"
ErrEmptySchemaCode = "replace_me"
ErrMarshalingRegisteryAttemptsCode = "replace_me"
ErrWritingRegisteryAttemptsCode = "replace_me"
ErrRegisteringEntityCode = "replace_me"
ErrUnknownHostInMapCode = "replace_me"
ErrCreatingUserDataDirectoryCode = "replace_me"

)

func ErrUnknownHost(err error) error {
Expand Down
2 changes: 1 addition & 1 deletion utils/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ func (tw *TarWriter) Compress(name string, data []byte) error {
func (tw *TarWriter) Close() {
_ = tw.Writer.Flush()
_ = tw.Writer.Close()
}
}
2 changes: 1 addition & 1 deletion utils/catalog/artifacthub_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ type ArtifactHubMetadata struct {
Key1 string `yaml:"key1,omitempty"`
Key2 string `yaml:"key2,omitempty"`
} `yaml:"annotations,omitempty"`
}
}
2 changes: 1 addition & 1 deletion utils/catalog/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ func BuildArtifactHubPkg(name, downloadURL, user, version, createdAt string, cat
})

return artifacthubPkg
}
}
2 changes: 1 addition & 1 deletion utils/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,4 @@ func ErrExtractZip(err error, path string) error {

func ErrReadDir(err error, dirPath string) error {
return errors.New(ErrReadDirCode, errors.Alert, []string{"error reading directory"}, []string{err.Error()}, []string{fmt.Sprintf("Directory does not exist at the location %s", dirPath), "Insufficient permissions"}, []string{"Verify that directory exist at the provided location", "Verify sufficient directory read permission."})
}
}
1 change: 0 additions & 1 deletion utils/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func (s *GenerticThreadSafeStore[K]) Delete(key string) {
delete(s.data, key)
}


func (s *GenerticThreadSafeStore[K]) GetAllPairs() map[string]K {
values := make(map[string]K, 0)

Expand Down

0 comments on commit 2a73d8f

Please sign in to comment.