go.mod: Bump go version to 1.22 #259
8 changed files with 18 additions and 17 deletions
|
@ -13,7 +13,7 @@ jobs:
|
|||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '1.22'
|
||||
go-version: '1.23'
|
||||
|
||||
- name: Run commit format checker
|
||||
uses: https://git.frostfs.info/TrueCloudLab/dco-go@v3
|
||||
|
|
|
@ -11,7 +11,7 @@ jobs:
|
|||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '1.22'
|
||||
go-version: '1.23'
|
||||
cache: true
|
||||
|
||||
- name: Install linters
|
||||
|
@ -25,7 +25,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go_versions: [ '1.21', '1.22' ]
|
||||
go_versions: [ '1.22', '1.23' ]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
|
|
@ -12,7 +12,8 @@ run:
|
|||
# output configuration options
|
||||
output:
|
||||
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
|
||||
format: tab
|
||||
formats:
|
||||
- format: tab
|
||||
|
||||
# all available settings of specific linters
|
||||
linters-settings:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM golang:1.21
|
||||
FROM golang:1.22
|
||||
|
||||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install make openjdk-17-jre -y
|
||||
WORKDIR /work
|
||||
|
|
4
Makefile
4
Makefile
|
@ -2,8 +2,8 @@
|
|||
|
||||
ANTLR_VERSION="4.13.0"
|
||||
TMP_DIR := .cache
|
||||
LINT_VERSION ?= 1.56.2
|
||||
TRUECLOUDLAB_LINT_VERSION ?= 0.0.2
|
||||
LINT_VERSION ?= 1.60.1
|
||||
TRUECLOUDLAB_LINT_VERSION ?= 0.0.6
|
||||
OUTPUT_LINT_DIR ?= $(shell pwd)/bin
|
||||
LINT_DIR = $(OUTPUT_LINT_DIR)/golangci-lint-$(LINT_VERSION)-v$(TRUECLOUDLAB_LINT_VERSION)
|
||||
|
||||
|
|
2
go.mod
2
go.mod
|
@ -1,6 +1,6 @@
|
|||
module git.frostfs.info/TrueCloudLab/frostfs-sdk-go
|
||||
|
||||
go 1.21
|
||||
go 1.22
|
||||
|
||||
require (
|
||||
git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240819074700-a43110e36326
|
||||
|
|
|
@ -73,8 +73,8 @@ func newMinAgg() aggregator {
|
|||
|
||||
// newReverseMinNorm returns a normalizer which
|
||||
// normalize values in range of 0.0 to 1.0 to a minimum value.
|
||||
func newReverseMinNorm(min float64) normalizer {
|
||||
return &reverseMinNorm{min: min}
|
||||
func newReverseMinNorm(minV float64) normalizer {
|
||||
return &reverseMinNorm{min: minV}
|
||||
}
|
||||
|
||||
// newSigmoidNorm returns a normalizer which
|
||||
|
@ -125,22 +125,22 @@ func (a *meanIQRAgg) Compute() float64 {
|
|||
|
||||
slices.Sort(a.arr)
|
||||
|
||||
var min, max float64
|
||||
var minV, maxV float64
|
||||
|
||||
const minLn = 4
|
||||
|
||||
if l < minLn {
|
||||
min, max = a.arr[0], a.arr[l-1]
|
||||
minV, maxV = a.arr[0], a.arr[l-1]
|
||||
} else {
|
||||
start, end := l/minLn, l*3/minLn-1
|
||||
min, max = a.arr[start], a.arr[end]
|
||||
minV, maxV = a.arr[start], a.arr[end]
|
||||
}
|
||||
|
||||
count := 0
|
||||
sum := float64(0)
|
||||
|
||||
for _, e := range a.arr {
|
||||
if e >= min && e <= max {
|
||||
if e >= minV && e <= maxV {
|
||||
sum += e
|
||||
count++
|
||||
}
|
||||
|
|
|
@ -94,14 +94,14 @@ func (c *context) addUsedNodes(ns ...NodeInfo) {
|
|||
|
||||
func defaultWeightFunc(ns nodes) weightFunc {
|
||||
mean := newMeanAgg()
|
||||
min := newMinAgg()
|
||||
minV := newMinAgg()
|
||||
|
||||
for i := range ns {
|
||||
mean.Add(float64(ns[i].capacity()))
|
||||
min.Add(float64(ns[i].Price()))
|
||||
minV.Add(float64(ns[i].Price()))
|
||||
}
|
||||
|
||||
return newWeightFunc(
|
||||
newSigmoidNorm(mean.Compute()),
|
||||
newReverseMinNorm(min.Compute()))
|
||||
newReverseMinNorm(minV.Compute()))
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue