diff --git a/godotenv.go b/godotenv.go index 69e816c..031319e 100644 --- a/godotenv.go +++ b/godotenv.go @@ -222,29 +222,6 @@ func parseLine(line string, envMap map[string]string) (key string, value string, return } - // ditch the comments (but keep quoted hashes) - if strings.Contains(line, "#") { - segmentsBetweenHashes := strings.Split(line, "#") - quotesAreOpen := false - var segmentsToKeep []string - for _, segment := range segmentsBetweenHashes { - if strings.Count(segment, "\"") == 1 || strings.Count(segment, "'") == 1 { - if quotesAreOpen { - quotesAreOpen = false - segmentsToKeep = append(segmentsToKeep, segment) - } else { - quotesAreOpen = true - } - } - - if len(segmentsToKeep) == 0 || quotesAreOpen { - segmentsToKeep = append(segmentsToKeep, segment) - } - } - - line = strings.Join(segmentsToKeep, "#") - } - firstEquals := strings.Index(line, "=") firstColon := strings.Index(line, ":") splitString := strings.SplitN(line, "=", 2)