mirror of
https://github.com/sony/sonyflake.git
synced 2025-12-23 05:05:14 +00:00
Fix lint errors (#70)
This commit is contained in:
8
.github/workflows/test-v1.yml
vendored
8
.github/workflows/test-v1.yml
vendored
@@ -5,12 +5,14 @@ on:
|
||||
paths-ignore:
|
||||
- README.md
|
||||
- .github/workflows/test-v2.yml
|
||||
- 'v2/**'
|
||||
- v2/**
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- README.md
|
||||
- .github/workflows/test-v2.yml
|
||||
- 'v2/**'
|
||||
- v2/**
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
test-v1:
|
||||
@@ -30,7 +32,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{matrix.go-version}}
|
||||
|
||||
|
||||
6
.github/workflows/test-v2.yml
vendored
6
.github/workflows/test-v2.yml
vendored
@@ -5,12 +5,14 @@ on:
|
||||
paths:
|
||||
- README.md
|
||||
- .github/workflows/test-v2.yml
|
||||
- 'v2/**'
|
||||
- v2/**
|
||||
pull_request:
|
||||
paths:
|
||||
- README.md
|
||||
- .github/workflows/test-v2.yml
|
||||
- 'v2/**'
|
||||
- v2/**
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
test-v2:
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +1,4 @@
|
||||
example/example
|
||||
example/sonyflake_server
|
||||
v2/example/example
|
||||
v2/example/sonyflake_server
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
FROM ubuntu:14.04
|
||||
|
||||
ADD ./sonyflake_server /
|
||||
ENTRYPOINT ["/sonyflake_server"]
|
||||
COPY ./sonyflake_server /sonyflake_server
|
||||
|
||||
RUN useradd -m sonyflake
|
||||
USER sonyflake
|
||||
|
||||
ENTRYPOINT ["/sonyflake_server"]
|
||||
EXPOSE 8080
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
Example
|
||||
=======
|
||||
# Example
|
||||
|
||||
This example runs Sonyflake on AWS Elastic Beanstalk.
|
||||
|
||||
Setup
|
||||
-----
|
||||
## Setup
|
||||
|
||||
1. Build the cross compiler for linux/amd64 if using other platforms.
|
||||
|
||||
```
|
||||
cd $GOROOT/src && GOOS=linux GOARCH=amd64 ./make.bash
|
||||
```
|
||||
```bash
|
||||
cd $GOROOT/src && GOOS=linux GOARCH=amd64 ./make.bash
|
||||
```
|
||||
|
||||
2. Build sonyflake_server in the example directory.
|
||||
|
||||
```
|
||||
./linux64_build.sh
|
||||
```
|
||||
```bash
|
||||
./linux64_build.sh
|
||||
```
|
||||
|
||||
3. Upload the example directory to AWS Elastic Beanstalk.
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
FROM ubuntu:24.04
|
||||
|
||||
ADD ./sonyflake_server /
|
||||
ENTRYPOINT ["/sonyflake_server"]
|
||||
COPY ./sonyflake_server /sonyflake_server
|
||||
|
||||
RUN useradd -m sonyflake
|
||||
USER sonyflake
|
||||
|
||||
ENTRYPOINT ["/sonyflake_server"]
|
||||
EXPOSE 8080
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
Example
|
||||
=======
|
||||
# Example
|
||||
|
||||
This example runs Sonyflake on AWS Elastic Beanstalk.
|
||||
|
||||
Setup
|
||||
-----
|
||||
## Setup
|
||||
|
||||
1. Build the cross compiler for linux/amd64 if using other platforms.
|
||||
|
||||
```
|
||||
cd $GOROOT/src && GOOS=linux GOARCH=amd64 ./make.bash
|
||||
```
|
||||
```bash
|
||||
cd $GOROOT/src && GOOS=linux GOARCH=amd64 ./make.bash
|
||||
```
|
||||
|
||||
2. Build sonyflake_server in the example directory.
|
||||
|
||||
```
|
||||
./linux64_build.sh
|
||||
```
|
||||
```bash
|
||||
./linux64_build.sh
|
||||
```
|
||||
|
||||
3. Upload the example directory to AWS Elastic Beanstalk.
|
||||
|
||||
@@ -247,6 +247,7 @@ func lower16BitPrivateIP(interfaceAddrs types.InterfaceAddrs) (int, error) {
|
||||
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 {
|
||||
return time.Unix(0, (sf.startTime+sf.timePart(id))*sf.timeUnit)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user