Skip to content

Commit

Permalink
Fixed "Output" (exercism#2202) - Some Remaining files
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilingu committed Jun 24, 2022
1 parent 1391485 commit 629a3bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions concepts/booleans/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ Booleans in Go are represented by the `bool` type, which values can be either `t
Go supports three [boolean operators][logical operators]: `!` (NOT), `&&` (AND), and `||` (OR).

```go
true || false // Output: true
true && false // Output: false
!true // Output: false
true || false // => true
true && false // => false
!true // => false
```

The three boolean operators each have a different [_operator precedence_][operators]. As a consequence, they are evaluated in this order: `!` first, `&&` second, and finally `||`. If you want to 'escape' these rules, you can enclose a boolean expression in parentheses (`()`), as the parentheses have an even higher operator precedence.

```go
!true && false // Output: false
!(true && false) // Output: true
!true && false // => false
!(true && false) // => true
```

[operators]: https://golang.org/ref/spec#Operators
Expand Down
10 changes: 5 additions & 5 deletions concepts/booleans/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ A `bool` is either `true` or `false`.
Go supports three boolean operators: `!` (NOT), `&&` (AND), and `||` (OR).

```go
true || false // Output: true
true && false // Output: false
!true // Output: false
true || false // => true
true && false // => false
!true // => false
```

The three boolean operators each have a different _operator precedence_.
As a consequence, they are evaluated in this order: `!` first, `&&` second, and finally `||`.
If you want to force a different ordering, you can enclose a boolean expression in parentheses (ie. `()`), as the parentheses have an even higher operator precedence.

```go
!true && false // Output: false
!(true && false) // Output: true
!true && false // => false
!(true && false) // => true
```
6 changes: 3 additions & 3 deletions concepts/strings-package/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The [`strings` package](https://pkg.go.dev/strings) contains many useful functio
```go
import "strings"

strings.ToLower("Gopher") // Output: "gopher"
strings.Index("Apple", "le") // Output: 3
strings.Count("test", "t") // Output: 2
strings.ToLower("Gopher") // => "gopher"
strings.Index("Apple", "le") // => 3
strings.Count("test", "t") // => 2
```

0 comments on commit 629a3bb

Please sign in to comment.