Browse Source

clean doesn't need to be exported

Piotr Czajkowski 3 years ago
parent
commit
a6502bc900
2 changed files with 3 additions and 4 deletions
  1. 2 3
      search.go
  2. 1 1
      search_test.go

+ 2 - 3
search.go

@@ -12,8 +12,7 @@ type Segment struct {
 	Source, Target string
 }
 
-// Clean cleans <seg> tags from source and translated texts.
-func (s *Segment) Clean() {
+func (s *Segment) clean() {
 	re := regexp.MustCompile("</?seg>")
 	s.Source = re.ReplaceAllString(s.Source, "")
 	s.Target = re.ReplaceAllString(s.Target, "")
@@ -63,7 +62,7 @@ func getCleanedResults(tempResults ResultsFromServer, TMFriendlyName string) Cle
 
 	for _, result := range tempResults.ConcResult {
 		segment := Segment{result.TMEntry.SourceSegment, result.TMEntry.TargetSegment}
-		segment.Clean()
+		segment.clean()
 		tmResults.Segments = append(tmResults.Segments, segment)
 	}
 	return tmResults

+ 1 - 1
search_test.go

@@ -18,7 +18,7 @@ func TestSegmentCleanup(t *testing.T) {
 	cleanedTargetSegment := "This is test for target"
 
 	segment := Segment{sourceSegment, targetSegment}
-	segment.Clean()
+	segment.clean()
 
 	t.Log("Testing if <seg> tags will be removed from segments.")
 	if segment.Source == cleanedSourceSegment && segment.Target == cleanedTargetSegment {