Replace a "fixme" with a more appropriate error. Also invert the condition
so that the error returns early, which is more Go idiomatic.
Change-Id: I03006572c4010fb47037bed3ee1fd7f92bfc20d3
Reviewed-on: https://go-review.googlesource.com/c/go/+/523457
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: M Zhuo <mzh@golangcn.org>
if err != nil {
return 0, err
}
- if enc.length > 0 {
- return enc.encode(ins), nil
+ if enc.length <= 0 {
+ return 0, fmt.Errorf("%v: encoding called for a pseudo instruction", ins.as)
}
- return 0, fmt.Errorf("fixme")
+ return enc.encode(ins), nil
}
func (ins *instruction) length() int {