mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
Replace deprecated strings.Title
This commit is contained in:
parent
db5468a886
commit
aaa5d2ab66
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user