Skip to content

Commit

Permalink
refactor: renamed unsafe2->hack
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaost committed Jul 19, 2024
1 parent 7257865 commit 8b69865
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/unsafe2/unsafe.go → internal/hack/hack.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package unsafe2
package hack

import "unsafe"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package unsafe2
package hack

import (
"testing"
Expand Down
4 changes: 2 additions & 2 deletions protocol/thrift/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"math"
"unsafe"

"github.com/cloudwego/gopkg/internal/unsafe2"
"github.com/cloudwego/gopkg/internal/hack"
)

var Binary BinaryProtocol
Expand Down Expand Up @@ -121,7 +121,7 @@ func (BinaryProtocol) WriteString(buf []byte, v string) int {
}

func (p BinaryProtocol) WriteStringNocopy(buf []byte, w NocopyWriter, v string) int {
return p.WriteBinaryNocopy(buf, w, unsafe2.StringToByteSlice(v))
return p.WriteBinaryNocopy(buf, w, hack.StringToByteSlice(v))
}

// Append methods
Expand Down

0 comments on commit 8b69865

Please sign in to comment.