Fixed RmFront panic.
This commit is contained in:
@ -9,12 +9,13 @@ func (resp Resp) Check() bool {
|
||||
}
|
||||
|
||||
func (resp Resp) RmFront(str string) Resp {
|
||||
if !resp.Check() {
|
||||
return RespNil
|
||||
}
|
||||
return Resp(string(resp)[len(str):])
|
||||
}
|
||||
|
||||
func (resp Resp) CheckFront(str string) bool {
|
||||
return len(resp) >= len(str) && resp[:len(str)].String() == str
|
||||
}
|
||||
|
||||
func (resp Resp) String() string {
|
||||
return string(resp)
|
||||
}
|
||||
|
Reference in New Issue
Block a user