From 45faed057c09a9e25512016aecd94edb9329e221 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 14 Nov 2023 11:25:16 +0000 Subject: [PATCH] Improve SliceExpr documentation --- go/ql/lib/semmle/go/Expr.qll | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/go/ql/lib/semmle/go/Expr.qll b/go/ql/lib/semmle/go/Expr.qll index 90f838c2174..66d79f1d8f4 100644 --- a/go/ql/lib/semmle/go/Expr.qll +++ b/go/ql/lib/semmle/go/Expr.qll @@ -724,16 +724,19 @@ class GenericTypeInstantiationExpr extends Expr { * ```go * a[1:3] * a[1:3:5] + * a[1:] + * a[:3] + * a[:] * ``` */ class SliceExpr extends @sliceexpr, Expr { /** Gets the base of this slice expression. */ Expr getBase() { result = this.getChildExpr(0) } - /** Gets the lower bound of this slice expression. */ + /** Gets the lower bound of this slice expression, if any. */ Expr getLow() { result = this.getChildExpr(1) } - /** Gets the upper bound of this slice expression. */ + /** Gets the upper bound of this slice expression, if any. */ Expr getHigh() { result = this.getChildExpr(2) } /** Gets the maximum of this slice expression, if any. */