Golang in directly execute code (Evaling)


package main

import (
const EAX = 0x01

func returnStr() string {
    return "(EAX<<EAX<<EAX<<EAX<<EAX<<EAX<<EAX^EAX)"
func main() {
    fmt.Println((EAX<<EAX<<EAX<<EAX<<EAX<<EAX<<EAX^EAX)) //65

Hi guys,

This function returns as string but still output as string. What can I do to make the output 65?

Hi. Go don’t substitute constant names inside strings with their value. You must do the calculation and then convert it to a string:


1 Like

If you return a string your going to get a string.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.