Skip to content

Commit

Permalink
user: add ifname's default value of gotls module.
Browse files Browse the repository at this point in the history
Signed-off-by: CFC4N <[email protected]>
  • Loading branch information
cfc4n committed Mar 16, 2023
1 parent 6672906 commit 20fc646
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions user/config/config_gotls.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
// Copyright 2022 CFC4N <[email protected]>. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright © 2022 Hengqi Chen
package config

Expand Down Expand Up @@ -28,6 +41,11 @@ func (c *GoTLSConfig) Check() error {
if c.Path == "" {
return ErrorGoBINNotSET
}

if c.Ifname == "" || len(c.Ifname) == 0 {
c.Ifname = DefaultIfname
}

_, err := os.Stat(c.Path)
return err
}

0 comments on commit 20fc646

Please sign in to comment.