Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Get dependencies
run: |
go get -v -t -d ./...
go mod download

- name: Build
run: go build -v ./...
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version-file: go.mod
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v9
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.62
version: v2.13.0

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/digitorus/timestamp

go 1.16
go 1.27

require github.com/digitorus/pkcs7 v0.0.0-20230713084857-e76b763bdc49
require github.com/digitorus/pkcs7 v0.0.0-20260914070511-d678ea5ea03f
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github.com/digitorus/pkcs7 v0.0.0-20230713084857-e76b763bdc49 h1:h+XMRXf+WLY0h/3itqE8OT3TgjCMHK4nq2FNGi0au2c=
github.com/digitorus/pkcs7 v0.0.0-20230713084857-e76b763bdc49/go.mod h1:SKVExuS+vpu2l9IoOc0RwqE7NYnb0JlcFHFnEJkVDzc=
github.com/digitorus/pkcs7 v0.0.0-20260914070511-d678ea5ea03f h1:LBDTasGDT7gkpSl3tIq+V4Yy0nr+l+ZmI6VN9MY9FU0=
github.com/digitorus/pkcs7 v0.0.0-20260914070511-d678ea5ea03f/go.mod h1:OQvyvldkvDCxGsUPLSibXqM4B/Pz5RaXQP4CPo5LXs4=
6 changes: 3 additions & 3 deletions timestamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,9 @@ func (t *Timestamp) populateTSTInfo(messageImprint messageImprint, policyOID asn
if ms != 0 {
tstInfo.Accuracy.Milliseconds = int64(ms.Milliseconds())
}
microSeconds := (t.Accuracy - seconds - ms).Truncate(time.Microsecond)
if microSeconds != 0 {
tstInfo.Accuracy.Microseconds = int64(microSeconds.Microseconds())
us := (t.Accuracy - seconds - ms).Truncate(time.Microsecond)
if us != 0 {
tstInfo.Accuracy.Microseconds = int64(us.Microseconds())
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions timestamp_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ import (
"github.com/digitorus/timestamp"
)

// ExampleCreateRequest_ParseResponse demonstrates the creation of a time-stamp request, sending
// ExampleCreateRequest_parseResponse demonstrates the creation of a time-stamp request, sending
// it to the server and parsing the response.
// nolint: govet
func ExampleCreateRequest_ParseResponse() {
func ExampleCreateRequest_parseResponse() {
tsq, err := timestamp.CreateRequest(strings.NewReader("ExampleCreateRequestParseResponse"), &timestamp.RequestOptions{
Hash: crypto.SHA256,
Certificates: true,
Expand Down Expand Up @@ -43,7 +42,7 @@ func ExampleCreateRequest_ParseResponse() {
log.Fatal(err)
}

fmt.Println(tsResp.HashedMessage)
fmt.Printf("%v\n", tsResp.HashedMessage)
fmt.Println(tsResp.Policy)
for _, c := range tsResp.Certificates {
fmt.Println(c.Subject.Organization, c.Subject.OrganizationalUnit)
Expand Down
Loading