File: disable.go

package info (click to toggle)
tml 0.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 168 kB
  • sloc: makefile: 16
file content (18 lines) | stat: -rw-r--r-- 307 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package tml

import "sync"

var disableFormatting bool
var formattingLock sync.RWMutex

func DisableFormatting() {
	formattingLock.Lock()
	defer formattingLock.Unlock()
	disableFormatting = true
}

func EnableFormatting() {
	formattingLock.Lock()
	defer formattingLock.Unlock()
	disableFormatting = false
}