Skip to content

Commit

Permalink
chore: cleanup deprecated functions (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
nrwiersma authored Oct 2, 2023
1 parent dfd33e8 commit 822e0c9
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 191 deletions.
30 changes: 0 additions & 30 deletions http/json.go

This file was deleted.

71 changes: 0 additions & 71 deletions http/json_test.go

This file was deleted.

42 changes: 0 additions & 42 deletions ptr/ptr.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,3 @@ package ptr
func Of[T any](v T) *T {
return &v
}

// Bool converts a bool into a bool pointer.
//
// Deprecated: Use Of instead.
func Bool(b bool) *bool {
return &b
}

// Float32 converts a float32 into a float32 pointer.
//
// Deprecated: Use Of instead.
func Float32(f float32) *float32 {
return &f
}

// Float64 converts a float64 into a float64 pointer.
//
// Deprecated: Use Of instead.
func Float64(f float64) *float64 {
return &f
}

// Int converts an int into an int pointer.
//
// Deprecated: Use Of instead.
func Int(i int) *int {
return &i
}

// Int64 converts an int64 into an int64 pointer.
//
// Deprecated: Use Of instead.
func Int64(i int64) *int64 {
return &i
}

// String converts a string into a string pointer.
//
// Deprecated: Use Of instead.
func String(s string) *string {
return &s
}
48 changes: 0 additions & 48 deletions ptr/ptr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,51 +14,3 @@ func TestOf(t *testing.T) {

assert.Exactly(t, &want, got)
}

func TestBool(t *testing.T) {
want := true

got := ptr.Bool(want)

assert.Exactly(t, &want, got)
}

func TestFloat32(t *testing.T) {
want := float32(1.0)

got := ptr.Float32(want)

assert.Exactly(t, &want, got)
}

func TestFloat64(t *testing.T) {
want := float64(1.0)

got := ptr.Float64(want)

assert.Exactly(t, &want, got)
}

func TestInt(t *testing.T) {
want := 1

got := ptr.Int(want)

assert.Exactly(t, &want, got)
}

func TestInt64(t *testing.T) {
want := int64(1)

got := ptr.Int64(want)

assert.Exactly(t, &want, got)
}

func TestString(t *testing.T) {
want := "foo"

got := ptr.String(want)

assert.Exactly(t, &want, got)
}

0 comments on commit 822e0c9

Please sign in to comment.