mirror of
https://github.com/sony/sonyflake.git
synced 2026-11-17 00:06:28 +00:00
Fix lint errors (#70)
This commit is contained in:
1 parent
d764be18d5
commit
59c47aeab1
10 files changed
+38
-29
No files matched your search
@@ -5,12 +5,14 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- README.md
|
- README.md
|
||||||
- .github/workflows/test-v2.yml
|
- .github/workflows/test-v2.yml
|
||||||
- 'v2/**'
|
- v2/**
|
||||||
pull_request:
|
pull_request:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- README.md
|
- README.md
|
||||||
- .github/workflows/test-v2.yml
|
- .github/workflows/test-v2.yml
|
||||||
- 'v2/**'
|
- v2/**
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-v1:
|
test-v1:
|
||||||
@@ -30,7 +32,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: ${{matrix.go-version}}
|
go-version: ${{matrix.go-version}}
|
||||||
|
|
||||||
|
|||||||
@@ -5,12 +5,14 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- README.md
|
- README.md
|
||||||
- .github/workflows/test-v2.yml
|
- .github/workflows/test-v2.yml
|
||||||
- 'v2/**'
|
- v2/**
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- README.md
|
- README.md
|
||||||
- .github/workflows/test-v2.yml
|
- .github/workflows/test-v2.yml
|
||||||
- 'v2/**'
|
- v2/**
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-v2:
|
test-v2:
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
|
example/example
|
||||||
example/sonyflake_server
|
example/sonyflake_server
|
||||||
|
v2/example/example
|
||||||
v2/example/sonyflake_server
|
v2/example/sonyflake_server
|
||||||
+5
-2
@@ -1,6 +1,9 @@
|
|||||||
FROM ubuntu:14.04
|
FROM ubuntu:14.04
|
||||||
|
|
||||||
ADD ./sonyflake_server /
|
COPY ./sonyflake_server /sonyflake_server
|
||||||
ENTRYPOINT ["/sonyflake_server"]
|
|
||||||
|
|
||||||
|
RUN useradd -m sonyflake
|
||||||
|
USER sonyflake
|
||||||
|
|
||||||
|
ENTRYPOINT ["/sonyflake_server"]
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
+8
-10
@@ -1,21 +1,19 @@
|
|||||||
Example
|
# Example
|
||||||
=======
|
|
||||||
|
|
||||||
This example runs Sonyflake on AWS Elastic Beanstalk.
|
This example runs Sonyflake on AWS Elastic Beanstalk.
|
||||||
|
|
||||||
Setup
|
## Setup
|
||||||
-----
|
|
||||||
|
|
||||||
1. Build the cross compiler for linux/amd64 if using other platforms.
|
1. Build the cross compiler for linux/amd64 if using other platforms.
|
||||||
|
|
||||||
```
|
```bash
|
||||||
cd $GOROOT/src && GOOS=linux GOARCH=amd64 ./make.bash
|
cd $GOROOT/src && GOOS=linux GOARCH=amd64 ./make.bash
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Build sonyflake_server in the example directory.
|
2. Build sonyflake_server in the example directory.
|
||||||
|
|
||||||
```
|
```bash
|
||||||
./linux64_build.sh
|
./linux64_build.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Upload the example directory to AWS Elastic Beanstalk.
|
3. Upload the example directory to AWS Elastic Beanstalk.
|
||||||
File renamed without changes.
@@ -1,6 +1,9 @@
|
|||||||
FROM ubuntu:24.04
|
FROM ubuntu:24.04
|
||||||
|
|
||||||
ADD ./sonyflake_server /
|
COPY ./sonyflake_server /sonyflake_server
|
||||||
ENTRYPOINT ["/sonyflake_server"]
|
|
||||||
|
|
||||||
|
RUN useradd -m sonyflake
|
||||||
|
USER sonyflake
|
||||||
|
|
||||||
|
ENTRYPOINT ["/sonyflake_server"]
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
+8
-10
@@ -1,21 +1,19 @@
|
|||||||
Example
|
# Example
|
||||||
=======
|
|
||||||
|
|
||||||
This example runs Sonyflake on AWS Elastic Beanstalk.
|
This example runs Sonyflake on AWS Elastic Beanstalk.
|
||||||
|
|
||||||
Setup
|
## Setup
|
||||||
-----
|
|
||||||
|
|
||||||
1. Build the cross compiler for linux/amd64 if using other platforms.
|
1. Build the cross compiler for linux/amd64 if using other platforms.
|
||||||
|
|
||||||
```
|
```bash
|
||||||
cd $GOROOT/src && GOOS=linux GOARCH=amd64 ./make.bash
|
cd $GOROOT/src && GOOS=linux GOARCH=amd64 ./make.bash
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Build sonyflake_server in the example directory.
|
2. Build sonyflake_server in the example directory.
|
||||||
|
|
||||||
```
|
```bash
|
||||||
./linux64_build.sh
|
./linux64_build.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Upload the example directory to AWS Elastic Beanstalk.
|
3. Upload the example directory to AWS Elastic Beanstalk.
|
||||||
File renamed without changes.
@@ -247,6 +247,7 @@ func lower16BitPrivateIP(interfaceAddrs types.InterfaceAddrs) (int, error) {
|
|||||||
return int(ip[2])<<8 + int(ip[3]), nil
|
return int(ip[2])<<8 + int(ip[3]), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ToTime returns the time when the given ID was generated.
|
||||||
func (sf *Sonyflake) ToTime(id int64) time.Time {
|
func (sf *Sonyflake) ToTime(id int64) time.Time {
|
||||||
return time.Unix(0, (sf.startTime+sf.timePart(id))*sf.timeUnit)
|
return time.Unix(0, (sf.startTime+sf.timePart(id))*sf.timeUnit)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user