Replace deprecated strings.Title

This commit is contained in:
katexochen 2022-06-01 10:36:32 +02:00 committed by Paul Meyer
parent db5468a886
commit aaa5d2ab66

View File

@ -2,11 +2,12 @@ package cloudtypes
import ( import (
"fmt" "fmt"
"strings"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork"
ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types"
"github.com/edgelesssys/constellation/internal/config" "github.com/edgelesssys/constellation/internal/config"
"golang.org/x/text/cases"
"golang.org/x/text/language"
computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
@ -46,7 +47,7 @@ func (f Firewall) Azure() ([]*armnetwork.SecurityRule, error) {
var fw []*armnetwork.SecurityRule var fw []*armnetwork.SecurityRule
for i, rule := range f { for i, rule := range f {
// format string according to armnetwork.SecurityRuleProtocol specification // format string according to armnetwork.SecurityRuleProtocol specification
protocol := strings.Title(strings.ToLower(rule.Protocol)) protocol := cases.Title(language.English).String(rule.Protocol)
dstPortRange, err := portOrRange(rule.FromPort, rule.ToPort) dstPortRange, err := portOrRange(rule.FromPort, rule.ToPort)
if err != nil { if err != nil {