Skip to content

Commit

Permalink
adjust code to the new schema
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm committed Jul 24, 2024
1 parent 6372f15 commit 392b0e8
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions internal/resource/infrastructure_stack_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,15 @@ func (isr *InfrastructureStackRepository) Attributes() gqlclient.GitRefAttribute
}
}

func (isr *InfrastructureStackRepository) From(repository *gqlclient.GitRepositoryFragment, ref *gqlclient.GitRefFragment) {
func (isr *InfrastructureStackRepository) From(repository *gqlclient.GitRepositoryFragment, ref gqlclient.GitRefFragment) {
isr.Ref = types.StringValue(ref.Ref)

Check failure on line 171 in internal/resource/infrastructure_stack_model.go

View workflow job for this annotation

GitHub Actions / Lint

SA5011: possible nil pointer dereference (staticcheck)
isr.Folder = types.StringValue(ref.Folder)

Check failure on line 172 in internal/resource/infrastructure_stack_model.go

View workflow job for this annotation

GitHub Actions / Lint

SA5011: possible nil pointer dereference (staticcheck)

if isr == nil {

Check failure on line 174 in internal/resource/infrastructure_stack_model.go

View workflow job for this annotation

GitHub Actions / Lint

SA5011(related information): this check suggests that the pointer can be nil (staticcheck)
return
}

isr.Id = types.StringValue(repository.ID)

if ref == nil {
return
}

isr.Ref = types.StringValue(ref.Ref)
isr.Folder = types.StringValue(ref.Folder)
}

type InfrastructureStackHookSpec struct {
Expand Down Expand Up @@ -270,8 +266,8 @@ func (isc *InfrastructureStackConfiguration) Attributes(ctx context.Context, d d
}
}

func (isc *InfrastructureStackConfiguration) From(ctx context.Context, configuration *gqlclient.StackConfigurationFragment, d diag.Diagnostics) {
if isc == nil || configuration == nil {
func (isc *InfrastructureStackConfiguration) From(ctx context.Context, configuration gqlclient.StackConfigurationFragment, d diag.Diagnostics) {
if isc == nil {
return
}

Expand Down

0 comments on commit 392b0e8

Please sign in to comment.