Delete copypasta comments

This commit is contained in:
eyedeekay
2025-02-01 22:19:19 -05:00
parent a5e36235d5
commit 978adf77ea
6 changed files with 10 additions and 6 deletions

2
Makefile Normal file
View File

@ -0,0 +1,2 @@
fmt:
find . -name '*.go' -exec gofumpt -w -s -extra {} \;

View File

@ -39,7 +39,7 @@ func ConvertCommand(c *cli.Context) error {
fmt.Println(string(outputData))
} else {
outputFile := c.Args().Get(1)
if err := os.WriteFile(outputFile, outputData, 0644); err != nil {
if err := os.WriteFile(outputFile, outputData, 0o644); err != nil {
return fmt.Errorf("failed to write output file: %w", err)
}
}

View File

@ -46,7 +46,7 @@ func (c *Converter) validate(config *TunnelConfig) error {
// Converter handles configuration format conversions
type Converter struct {
strict bool
//logger Logger
// logger Logger
}
// Convert transforms between configuration formats

View File

@ -23,7 +23,11 @@ func (c *Converter) parseINI(input []byte) (*TunnelConfig, error) {
parts := strings.SplitN(line, "=", 2)
if len(parts) != 2 {
continue
if strings.HasPrefix(line, "[") && strings.HasSuffix(line, "]") {
config.Name = strings.TrimSuffix(strings.TrimPrefix(line, "["), "]")
} else {
continue
}
}
key := strings.TrimSpace(parts[0])

View File

@ -8,7 +8,6 @@ import (
"github.com/magiconair/properties"
)
// Example Java properties parser
func (c *Converter) parseJavaProperties(input []byte) (*TunnelConfig, error) {
p := properties.MustLoadString(string(input))
@ -27,7 +26,7 @@ func (c *Converter) parseJavaProperties(input []byte) (*TunnelConfig, error) {
return config, nil
}
func (c *Converter) parsePropertyKey(k string, s string, config *TunnelConfig) {
func (c *Converter) parsePropertyKey(k, s string, config *TunnelConfig) {
if strings.HasPrefix(k, "#") {
return
}

View File

@ -2,7 +2,6 @@ package i2pconv
import "gopkg.in/yaml.v2"
// Example YAML parser
func (c *Converter) parseYAML(input []byte) (*TunnelConfig, error) {
config := &TunnelConfig{}
err := yaml.Unmarshal(input, config)