Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
gostnops
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wei.xuan
gostnops
Commits
d38547d0
Commit
d38547d0
authored
Jun 29, 2019
by
AlexStocks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mod: add bytes introduction
parent
44a37e92
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
25 deletions
+10
-25
README.md
README.md
+10
-3
slice.go
strings/slice.go
+0
-22
No files found.
README.md
View file @
d38547d0
...
...
@@ -2,6 +2,14 @@
A go sdk for
[
Apache Dubbo-go
](
github.com/apache/dubbo-go
)
.
## bytes
*
BytesBufferPool
> bytes.Buffer pool
*
SlicePool
> slice pool
## sync
> deadlock
...
...
@@ -10,9 +18,8 @@ Copy from [go-deadlock](https://github.com/sasha-s/go-deadlock) and add EnableDe
## strings
> string <--> slice
Convert from string to slice or from slice to string asap.
*
IsNil
> check a var is nil or not.
## time
...
...
strings/slice.go
deleted
100644 → 0
View file @
44a37e92
// Copyright 2016 ~ 2018 AlexStocks(https://github.com/AlexStocks).
// All rights reserved. Use of this source code is
// governed by Apache License 2.0.
package
gxstrings
import
(
"reflect"
"unsafe"
)
// returns &s[0], which is not allowed in go
func
StringPointer
(
s
string
)
unsafe
.
Pointer
{
p
:=
(
*
reflect
.
StringHeader
)(
unsafe
.
Pointer
(
&
s
))
return
unsafe
.
Pointer
(
p
.
Data
)
}
// returns &b[0], which is not allowed in go
func
BytePointer
(
b
[]
byte
)
unsafe
.
Pointer
{
p
:=
(
*
reflect
.
SliceHeader
)(
unsafe
.
Pointer
(
&
b
))
return
unsafe
.
Pointer
(
p
.
Data
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment