mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
cleanup: replace TypeToPtr helper methods with pointer.Of (#14151)
Bumping compile time requirement to go 1.18 allows us to simplify our pointer helper methods.
This commit is contained in:
committed by
GitHub
parent
b9fec224ba
commit
c4be2c6078
@@ -10,7 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
log "github.com/hashicorp/go-hclog"
|
||||
"github.com/hashicorp/nomad/helper"
|
||||
"github.com/hashicorp/nomad/helper/pointer"
|
||||
"github.com/hashicorp/nomad/plugins/base"
|
||||
"github.com/hashicorp/nomad/plugins/device"
|
||||
"github.com/hashicorp/nomad/plugins/shared/hclspec"
|
||||
@@ -343,23 +343,23 @@ func (d *FsDevice) collectStats() (*device.DeviceGroupStats, error) {
|
||||
|
||||
s := &device.DeviceStats{
|
||||
Summary: &structs.StatValue{
|
||||
IntNumeratorVal: helper.Int64ToPtr(f.Size()),
|
||||
IntNumeratorVal: pointer.Of(f.Size()),
|
||||
Unit: "bytes",
|
||||
Desc: "Filesize in bytes",
|
||||
},
|
||||
Stats: &structs.StatObject{
|
||||
Attributes: map[string]*structs.StatValue{
|
||||
"size": {
|
||||
IntNumeratorVal: helper.Int64ToPtr(f.Size()),
|
||||
IntNumeratorVal: pointer.Of(f.Size()),
|
||||
Unit: "bytes",
|
||||
Desc: "Filesize in bytes",
|
||||
},
|
||||
"modify_time": {
|
||||
StringVal: helper.StringToPtr(f.ModTime().String()),
|
||||
StringVal: pointer.Of(f.ModTime().String()),
|
||||
Desc: "Last modified",
|
||||
},
|
||||
"mode": {
|
||||
StringVal: helper.StringToPtr(f.Mode().String()),
|
||||
StringVal: pointer.Of(f.Mode().String()),
|
||||
Desc: "File mode",
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user