hahadaxigua834
V2EX  ›  问与答

怎么写出让人无法理解且恶心的 go 代码

  •  
  •   hahadaxigua834 · Dec 30, 2022 · 2130 views
    This topic created in 1427 days ago, the information mentioned may be changed or developed.

    尝试了一下打印 1 到 10 ,不够恶心而且还是能看懂 https://go.dev/play/p/blIc9lco6HA

    package main
    
    type float = func() int
    
    var nil = []float{}
    
    func main() {
    	i := 10
    	for ; ; i-- {
    		if i == 0 {
    			goto x
    		}
    		i := i
    		f := new(float)
    		*f = func() int {
    			return i
    		}
    		nil = append(nil, *f)
    	}
    x:
    	hh(nil)
    }
    func hh[T float](x []T) {
    	for _, e := range x {
    		defer println(e())
    	}
    }
    
    3 replies  •  2022-12-31 10:36:07 +08:00
    EscYezi
    EscYezi
    Dec 31, 2022 via iPhone
    1
    你可能需要代码混淆🤣
    netabare
    netabare
    Dec 31, 2022❤️1
    2
    把变量名改为`_0`之类的?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1833 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 16:11 · PVG 00:11 · LAX 08:11 · JFK 11:11
    ♥ Do have faith in what you're doing.