fix(custom-openvpn): remove comments before parsing file
This commit is contained in:
@@ -18,6 +18,11 @@ var (
|
|||||||
func extractDataFromLines(lines []string) (
|
func extractDataFromLines(lines []string) (
|
||||||
connection models.Connection, err error) {
|
connection models.Connection, err error) {
|
||||||
for i, line := range lines {
|
for i, line := range lines {
|
||||||
|
hashSymbolIndex := strings.Index(line, "#")
|
||||||
|
if hashSymbolIndex >= 0 {
|
||||||
|
line = line[:hashSymbolIndex]
|
||||||
|
}
|
||||||
|
|
||||||
ip, port, protocol, err := extractDataFromLine(line)
|
ip, port, protocol, err := extractDataFromLine(line)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return connection, fmt.Errorf("on line %d: %w", i+1, err)
|
return connection, fmt.Errorf("on line %d: %w", i+1, err)
|
||||||
|
|||||||
Reference in New Issue
Block a user