hello, i have an php code i want to convert it to golang :
$file = '/usr/etcetc'; $filesize = filesize($file); $filech1 = file_get_contents('/etc/oct'); $posttt = strpos($filech1, '/etc/ggl/soft'); $posttt1 = strpos($filech1, 'myttt'); if ($posttt !== FALSE && 1 < $filesize && !$posttt1) { }
we can do strpos via strings.Index , but $posttt !== FALSE
and !$posttt1
how is it possible in golang ? when i do this it given me an error :
error of !$posttt1
-
invalid operation: operator ! not defined for filech2 (variable of type int)
error of $posttt !== FALSE
-
cannot convert false (untyped bool constant) to intcompiler