Below is a piece of code written in Go taken from Raft Locking Advice, rule 5:
rf.mu.Lock() rf.currentTerm += 1 rf.state = Candidate for