Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Go 言語でも (a==1 && a==2 && a==3) を true にしてみたい(クソリプ編) ref: https://qiita.com/spiegel-im-spiegel/items/16b15d0c646e2a0e3e7d
use strict;
use warnings;
my $a = 1;
my @a = (1, 2);
sub a { 3 };
if ($a == 1 and @a == 2 and &a == 3) {
print "True!\n";
}
package main
import (
"fmt"
)
func main() {
a := make(chan int)
go func() {
for i := 1; ; i++ {
a <- i
i %= 3
}
}()
if <-a == 1 && <-a == 2 && <-a == 3 {
fmt.Println("True!")
}
if <-a == 1 && <-a == 2 && <-a == 3 {
fmt.Println("True!")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment