Skip to content

Instantly share code, notes, and snippets.

@spiegel-im-spiegel
Last active January 23, 2018 05:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spiegel-im-spiegel/5b701b3f4d032576d742db9b40125174 to your computer and use it in GitHub Desktop.
Save spiegel-im-spiegel/5b701b3f4d032576d742db9b40125174 to your computer and use it in GitHub Desktop.
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