Strpos in golang

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

Hello, found the solution.
We can use posttt != -1

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