@@ -16,16 +16,16 @@ type writerAggregator struct {
1616 strings.Builder
1717}
1818
19- func (w * writerAggregator ) WriteStringF (format string , args ... any ) {
19+ func (w * writerAggregator ) WriteStringf (format string , args ... any ) {
2020 w .WriteString (fmt .Sprintf (format , args ... ))
2121}
2222
2323func (w * writerAggregator ) WriteLine (s string ) {
2424 w .WriteString (s + "\r \n " )
2525}
2626
27- func (w * writerAggregator ) WriteLineF (format string , args ... any ) {
28- w .WriteStringF (format + "\r \n " , args ... )
27+ func (w * writerAggregator ) WriteLinef (format string , args ... any ) {
28+ w .WriteStringf (format + "\r \n " , args ... )
2929}
3030
3131type sourceMapSpanWithDecodeErrors struct {
@@ -103,31 +103,31 @@ func newSourceMapSpanWriter(sourceMapRecorder *writerAggregator, sourceMap *sour
103103 }
104104
105105 sourceMapRecorder .WriteLine ("===================================================================" )
106- sourceMapRecorder .WriteLineF ("JsFile: %s" , sourceMap .File )
107- sourceMapRecorder .WriteLineF ("mapUrl: %s" , sourcemap .TryGetSourceMappingURL (sourcemap .CreateECMALineInfo (jsFile .Content , writer .jsLineMap )))
108- sourceMapRecorder .WriteLineF ("sourceRoot: %s" , sourceMap .SourceRoot )
109- sourceMapRecorder .WriteLineF ("sources: %s" , strings .Join (sourceMap .Sources , "," ))
106+ sourceMapRecorder .WriteLinef ("JsFile: %s" , sourceMap .File )
107+ sourceMapRecorder .WriteLinef ("mapUrl: %s" , sourcemap .TryGetSourceMappingURL (sourcemap .CreateECMALineInfo (jsFile .Content , writer .jsLineMap )))
108+ sourceMapRecorder .WriteLinef ("sourceRoot: %s" , sourceMap .SourceRoot )
109+ sourceMapRecorder .WriteLinef ("sources: %s" , strings .Join (sourceMap .Sources , "," ))
110110 if len (sourceMap .SourcesContent ) > 0 {
111111 content , err := json .Marshal (sourceMap .SourcesContent )
112112 if err != nil {
113113 panic (err )
114114 }
115- sourceMapRecorder .WriteLineF ("sourcesContent: %s" , content )
115+ sourceMapRecorder .WriteLinef ("sourcesContent: %s" , content )
116116 }
117117 sourceMapRecorder .WriteLine ("===================================================================" )
118118 return writer
119119}
120120
121121func (w * sourceMapSpanWriter ) getSourceMapSpanString (mapEntry * sourcemap.Mapping , getAbsentNameIndex bool ) string {
122122 var mapString writerAggregator
123- mapString .WriteStringF ("Emitted(%d, %d)" , mapEntry .GeneratedLine + 1 , mapEntry .GeneratedCharacter + 1 )
123+ mapString .WriteStringf ("Emitted(%d, %d)" , mapEntry .GeneratedLine + 1 , mapEntry .GeneratedCharacter + 1 )
124124 if mapEntry .IsSourceMapping () {
125- mapString .WriteStringF (" Source(%d, %d) + SourceIndex(%d)" , mapEntry .SourceLine + 1 , mapEntry .SourceCharacter + 1 , mapEntry .SourceIndex )
125+ mapString .WriteStringf (" Source(%d, %d) + SourceIndex(%d)" , mapEntry .SourceLine + 1 , mapEntry .SourceCharacter + 1 , mapEntry .SourceIndex )
126126 if mapEntry .NameIndex >= 0 && int (mapEntry .NameIndex ) < len (w .sourceMapNames ) {
127- mapString .WriteStringF (" name (%s)" , w .sourceMapNames [mapEntry .NameIndex ])
127+ mapString .WriteStringf (" name (%s)" , w .sourceMapNames [mapEntry .NameIndex ])
128128 } else {
129129 if mapEntry .NameIndex != sourcemap .MissingName || getAbsentNameIndex {
130- mapString .WriteStringF (" nameIndex (%d)" , mapEntry .NameIndex )
130+ mapString .WriteStringf (" nameIndex (%d)" , mapEntry .NameIndex )
131131 }
132132 }
133133 }
@@ -180,11 +180,11 @@ func (w *sourceMapSpanWriter) recordNewSourceFileSpan(sourceMapSpan *sourcemap.M
180180
181181 w .sourceMapRecorder .WriteLine ("-------------------------------------------------------------------" )
182182 if continuesLine {
183- w .sourceMapRecorder .WriteLineF ("emittedFile:%s (%d, %d)" , w .jsFile .UnitName , sourceMapSpan .GeneratedLine + 1 , sourceMapSpan .GeneratedCharacter + 1 )
183+ w .sourceMapRecorder .WriteLinef ("emittedFile:%s (%d, %d)" , w .jsFile .UnitName , sourceMapSpan .GeneratedLine + 1 , sourceMapSpan .GeneratedCharacter + 1 )
184184 } else {
185- w .sourceMapRecorder .WriteLineF ("emittedFile:%s" , w .jsFile .UnitName )
185+ w .sourceMapRecorder .WriteLinef ("emittedFile:%s" , w .jsFile .UnitName )
186186 }
187- w .sourceMapRecorder .WriteLineF ("sourceFile:%s" , w .sourceMapSources [w .spansOnSingleLine [0 ].sourceMapSpan .SourceIndex ])
187+ w .sourceMapRecorder .WriteLinef ("sourceFile:%s" , w .sourceMapSources [w .spansOnSingleLine [0 ].sourceMapSpan .SourceIndex ])
188188 w .sourceMapRecorder .WriteLine ("-------------------------------------------------------------------" )
189189
190190 w .tsLineMap = core .ComputeECMALineStarts (newSourceFileCode )
@@ -198,7 +198,7 @@ func (w *sourceMapSpanWriter) close() {
198198
199199 if ! w .sourceMapDecoder .hasCompletedDecoding () {
200200 w .sourceMapRecorder .WriteLine ("!!!! **** There are more source map entries in the sourceMap's mapping than what was encoded" )
201- w .sourceMapRecorder .WriteLineF ("!!!! **** Remaining decoded string: %s" , w .sourceMapDecoder .getRemainingDecodeString ())
201+ w .sourceMapRecorder .WriteLinef ("!!!! **** Remaining decoded string: %s" , w .sourceMapDecoder .getRemainingDecodeString ())
202202 }
203203
204204 // write remaining js lines
@@ -223,7 +223,7 @@ func (w *sourceMapSpanWriter) getTextOfLine(line int, lineMap []core.TextPos, co
223223
224224func (w * sourceMapSpanWriter ) writeJsFileLines (endJsLine int ) {
225225 for ; w .nextJsLineToWrite < endJsLine ; w .nextJsLineToWrite ++ {
226- w .sourceMapRecorder .WriteStringF (">>>%s" , w .getTextOfLine (w .nextJsLineToWrite , w .jsLineMap , w .jsFile .Content ))
226+ w .sourceMapRecorder .WriteStringf (">>>%s" , w .getTextOfLine (w .nextJsLineToWrite , w .jsLineMap , w .jsFile .Content ))
227227 }
228228}
229229
@@ -319,7 +319,7 @@ func (sw *recordedSpanWriter) writeSourceMapSourceText(currentSpan *sourceMapSpa
319319}
320320
321321func (sw * recordedSpanWriter ) writeSpanDetails (currentSpan * sourceMapSpanWithDecodeErrors , index int ) {
322- sw .w .sourceMapRecorder .WriteLineF ("%s%s" , sw .markerIds [index ], sw .w .getSourceMapSpanString (currentSpan .sourceMapSpan , false /*getAbsentNameIndex*/ ))
322+ sw .w .sourceMapRecorder .WriteLinef ("%s%s" , sw .markerIds [index ], sw .w .getSourceMapSpanString (currentSpan .sourceMapSpan , false /*getAbsentNameIndex*/ ))
323323}
324324
325325func (sw * recordedSpanWriter ) writeRecordedSpans () {
0 commit comments