MCPcopy Create free account
hub / github.com/JordanCoin/codemap / Render

Method Render

render/clone_animation.go:25–38  ·  view source on GitHub ↗

Render draws a single-line progress indicator with map emoji

(progress int)

Source from the content-addressed store, hash-verified

23
24// Render draws a single-line progress indicator with map emoji
25func (a *CloneAnimation) Render(progress int) {
26 // Move cursor to beginning of line and clear it
27 fmt.Fprint(a.w, "\r\033[K")
28
29 if progress < 0 {
30 progress = 0
31 }
32 if progress > 100 {
33 progress = 100
34 }
35
36 frame := a.buildFrame(progress)
37 fmt.Fprint(a.w, frame)
38}
39
40func (a *CloneAnimation) buildFrame(progress int) string {
41 var sb strings.Builder

Callers 3

cloneRepoFunction · 0.95
DemoMethod · 0.95

Calls 1

buildFrameMethod · 0.95

Tested by 1