Skip to content

Commit

Permalink
Remove unecessary print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
nimrodshn committed Dec 4, 2024
1 parent ab9daad commit a676eb2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
2 changes: 0 additions & 2 deletions pkg/concepts/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package concepts

import (
"log"
"sort"

"github.com/openshift-online/ocm-api-metamodel/pkg/names"
Expand Down Expand Up @@ -193,7 +192,6 @@ func (t *Type) RemoveAttribute(name *names.Name) {
}
for i, attribute := range t.attributes {
if attribute.Name().Equals(name) {
log.Printf("---------- Deleting attribute %s", name.String())
t.attributes = append(t.attributes[:i], t.attributes[i+1:]...)
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/language/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,8 @@ func (r *Reader) checkParameter(parameter *concepts.Parameter) {
}
if typ != nil && typ != parameter.Type() {
r.reporter.Errorf(
"Type of default value of parameter '%s' should be '%s', instead it was %s",
parameter, parameter.Type(), typ.Name().String(),
"Type of default value of parameter '%s' should be '%s'",
parameter, parameter.Type(),
)
}
}
Expand Down
14 changes: 3 additions & 11 deletions pkg/language/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,21 +472,13 @@ func (r *Reader) ExitClassDecl(ctx *ClassDeclContext) {

// A helper function to recursively add types to a version
func (r *Reader) recursivelyAddTypeToVersion(version *concepts.Version, typ *concepts.Type) {
var attributesToRemove concepts.AttributeSlice
// var attributesToRemove concepts.AttributeSlice
version.AddType(typ)
for _, attribute := range typ.Attributes() {
// We wish to define links explicitly and not inherint them
// only the attribute fields.
if version.FindType(attribute.Type().Name()) == nil && !attribute.Link() {
if version.FindType(attribute.Type().Name()) == nil {
r.recursivelyAddTypeToVersion(version, attribute.Type())
}
if attribute.Link() {
attributesToRemove = append(attributesToRemove, attribute)
}
}
for _, attribute := range attributesToRemove {
typ.RemoveAttribute(attribute.Name())
}
version.AddType(typ)
}

func (r *Reader) ExitStructDecl(ctx *StructDeclContext) {
Expand Down

0 comments on commit a676eb2

Please sign in to comment.