Skip to content

Commit

Permalink
ci: test on go 1.23rc1 (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 authored Jul 15, 2024
1 parent bacab46 commit 905d859
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go_version: ["~1.20", "~1.21", "~1.22", "1.23rc1"]
go_version: ["~1.20", "~1.21", "~1.22", "~1.23.0-rc.1"]

steps:
- uses: actions/checkout@v4
Expand Down
25 changes: 25 additions & 0 deletions api.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//go:build !go1.24

package phpserialize

import (
"fmt"

"github.com/trim21/go-phpserialize/internal/encoder"
)

func Marshal(v any) ([]byte, error) {
return encoder.Marshal(v)
}

func Unmarshal(data []byte, v any) error {
if len(data) == 0 {
return fmt.Errorf("empty bytes")
}

return unmarshal(data, v)
}

type Unmarshaler interface {
UnmarshalPHP([]byte) error
}
3 changes: 0 additions & 3 deletions internal/encoder/any.go

This file was deleted.

9 changes: 0 additions & 9 deletions internal/encoder/version.go

This file was deleted.

9 changes: 0 additions & 9 deletions marshal.go

This file was deleted.

12 changes: 0 additions & 12 deletions unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,6 @@ import (
"github.com/trim21/go-phpserialize/internal/errors"
)

type Unmarshaler interface {
UnmarshalPHP([]byte) error
}

func Unmarshal(data []byte, v any) error {
if len(data) == 0 {
return fmt.Errorf("empty bytes")
}

return unmarshal(data, v)
}

func unmarshal(data []byte, v any) error {
rv := reflect.ValueOf(v)

Expand Down

0 comments on commit 905d859

Please sign in to comment.