Skip to content

Commit

Permalink
Add AnySliceToTypedSlice and ToTypedSlice. Closes #78
Browse files Browse the repository at this point in the history
  • Loading branch information
kaidaguerre committed Nov 8, 2023
1 parent d6041c9 commit 3a09b29
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 790 deletions.
88 changes: 0 additions & 88 deletions hcl_helpers/convert.go

This file was deleted.

37 changes: 0 additions & 37 deletions hcl_helpers/convert_test.go

This file was deleted.

61 changes: 0 additions & 61 deletions hcl_helpers/hcl_blocks.go

This file was deleted.

64 changes: 0 additions & 64 deletions hcl_helpers/traversal.go

This file was deleted.

4 changes: 2 additions & 2 deletions type_conversion/slice.go → helpers/slice.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package type_conversion
package helpers

import (
"reflect"
Expand All @@ -8,7 +8,7 @@ import (
// AnySliceToTypedSlice determines whether input is []any and if so converts to an array of the underlying type
func AnySliceToTypedSlice(input any) any {
result := input
switch result.(type) {
switch result.(type) { //nolint:gocritic // TODO fix this gocritic lint suggestion
case []any:
val := reflect.ValueOf(result)
if val.Kind() == reflect.Slice {
Expand Down
Loading

0 comments on commit 3a09b29

Please sign in to comment.