golang setup

golang setup

71
NewbieNewbie
71

    Mar 19, 2019#1

    Got involved with a project using golang, found the wordfile but go isn't listed like PHP/Ruby. How do I get it to compile/debug?

    6,685587
    Grand MasterGrand Master
    6,685587

      Mar 19, 2019#2

      Neither IDM Computer Solutions nor an UEStudio user has created a configuration and a project template for golang according to what I see in project configuration dialog window respectively the subdirectories configs and projects in program files directory of UEStudio. So it looks like you are the first one using UEStudio for golang programming which means you have to create the configuration file for golang by yourself. I recommend to use a most suitable existing configuration as template for creating the golang configuration. Help on what can be used in a configuration file being a text file is documented in help of UEStudio. The suitable help pages are referenced all in help Index with [ at beginning making it easy to find them. It looks difficult to create a configuration, but in real it isn't on looking on existing configs, reading help and of course having good knowledge on how used compiler/interpreter works and which features controlled by which parameters the compiler/interpreter offers.
      Best regards from an UC/UE/UES for Windows user from Austria

      71
      NewbieNewbie
      71

        Mar 19, 2019#3

        That didn't work: I created a golang folder, added a file called application copied Tiny C application file to golang folder and modified it, saved shutdown UES restarted with an open .go file, it can't find the compiler.
        Cannot compile the file blah;blah;blah No compile tool is associated with the file EXTENSION.
        So I add a *.go extension but where do I associate the *.go to go?


        What is with storing configuration files in the Program Files directory? You do know that sucks...

        The compiler go is different, a Swiss knife thing, go build helloworld.go finds the src, compiles it, leaves the exe (Windows) in the same directory as the source, no linker, no asm, no switches. I can build for ARM or amd64 by changing GOARCH GOOS GOARM (version of ARM).
        If UES opens a file I should be able to compile it was executing go build $I and run the program with $T - The project files and file names like helloworld(0).go do not work with go, it tries to compile all files with *.go in the %UserProfile%\go\src\helloworld folder...

        I did find a go word file as well as RUST.

        6,685587
        Grand MasterGrand Master
        6,685587

          Mar 20, 2019#4

          The configuration file named for applications usually Application can be stored for example in project folder or a subfolder of the project file. It must not be stored in a subdirectory of configs in program files directory of UEStudio. Press Alt+Shift+S to open Project Settings dialog window. Select the tab Settings. Click on option Compilable to check it. Click on button Set/change compiler. There should be already the compiler Golang with item Application after having created already a subdirectory Golang in subdirectory of configs in program files directory of UEStudio with a file Application. Select this configuration and click on button Edit configuration. In opened window it is possible to edit the configuration file with syntax highlighting support. But first click on large button Make configuration local (save in project directory) to make it really editable without having permissions to write into a subdirectory of Program files directory. Later when the configuration is perfect for your needs, you can copy the configuration file to configs\Golang in program files directory of UEStudio with elevated permissions of a local administrator for easy usage for other projects also using Golang configuration.

          In the configuration you need a section [.GO] with at least Out = $In.out (or whatever Golang produces on compiling one source code file of a project with multiple source code files) and Cmd0 = ... This section defines for UEStudio how to process an input file with file extension GO on compiling a project.

          For a configuration the sections Settings, SettingsInfo, SettingsReps, General, Variables and Environment must be also defined once for the used compiler.

          The three Settings sections are for the window opened on clicking on tab Settings of Project Settings dialog window on button Compiler options to easily select options according to the definition in the compiler configuration for the current project. One option you should define is the Architecture, i.e. compile for ARM or amd64. The command line defined in section [.GO] executing Golang should reference at least this setting for architecture.

          [.GO] is for compiling just active file and for telling UEStudio how to compile one .GO file on build or rebuild a project with multiple *.GO files. For build or rebuild a project with multiple *.GO files the section [Build] defines how to build the project. There is defined usually with Out = $T the output of a build process, i.e. the .exe file in project directory with name of project on having in section [General] defined TargetExt with .exe as value. There must be usually also defined Depends in section [Build] to define which files of a project as defined with sections [FileGroups] and [GroupFormats] UEStudio should taking into account on building a project. You most likely need a file group for .go;. The variable name of this file group can be defined by you like FGGO in section [FileGroups] whereby there is most likely nothing to add in section [GroupFormats] for file group FGGO.

          I can help you better if you post the configuration you already have and a link to an online documentation of golang. I don't know anything golang compiler making it impossible for me to suggest what the configuration file for building an application using this compiler from within UEStudio should contain for a successful build or a project or just compilation of a single source file of the project.
          Best regards from an UC/UE/UES for Windows user from Austria

          71
          NewbieNewbie
          71

            Mar 21, 2019#5

            Ironically I came across Go for Visual Studio Code Alternatives which explains why those at the Stratux forum were asking what editor to use. Of course I recommended UEStudio. They (Stratux) used golang for the code hence Yet Another Language (YAL) syndrome, but I've found this YAL golang works for me, at 70 I seem to lose track of things, a lot, with golang it takes care of most of those issues. It (golang) can't do everything (embedded bare metal), yet, but writing a NMEA parser was trivial, porting it to ARM (6-7-8) suppose to be an eight/amd64/x86/MacOS even more so.   
            I'll add my current Application text at the end, not much there but I had to take a break. I did get the User Tools to work nicely. Execution of user tool with Ctrl+Shift+1 works nicely with user tool command line:

            cd %P && c:\go\bin\go.exe build %N%E && echo Done!

            If there is an error it shows in the output window. The wordfile does an amazing job of formatting, the go compiler re-formats the source when it compiles it.  

            Currently this doesn't work, wrong directory, go can't execute go build keeps asking me to use go help build - I'm still learning the golang methods but GOPATH and now *.mod files handle the compile sources all build around a distributed cloud of gits giving you the ability to simply rerun the compiler to get the latest git code before it compile, at least that is where they appear to be going.

            Code: Select all

            [Settings]
            
            Target = 
            Category&01 = DEFAULT RUN CONFIGURATION
            Working Directory =.
            Command Line Arguments =
            Category&02 = COMPILER OPTIONS
            Symbol Table Size = 1000
            Excluded Files = Excludes
            Libraries = 
            Compiler Options = 
            Linker Options =
            Debugger= 
            External Dependencies=yes|no
            
            [SettingsInfo]
            Target = 
            Working Directory = 
            Command Line Arguments = 
            Symbol Table Size = 
            Libraries = 
            Excluded Files = 
            Compiler Options = 
            Linker Options = 
            Debugger=
            External Dependencies=
            
            [Variables]
            
            CPATH =C:\go\bin
            INCLUDE = 
            LINK = 
            
            [Environment]
            
            PATH = $(CPATH)
            
            [General]
            
            TargetExt = .exe
            ReleaseOut = Release
            DebugOut = 
            UseFullPaths = 0
            UseDosNames = 0
            Excludes = $(Excluded Files)
            GenerateEDGroup=$(External Dependencies)
            
            [Execute Application]
            
            Title = Execute $T
            Cmd0 = $(Command Line Arguments)
            Depends = $T
            ShowWindow = 1
            DisplayConsole = 1
            
            [.go]
            
            Out = $In.exe
            ReleaseFlag = 
            DebugFlag = 
            Cmd0 = go build  
            
            IncFiles = 
            CaseSensitive = 
            IncDirs = 
            IncKeyWords = 
            Comments = /*.*/.//.eol.
            
            [SettingsReps]
            External Dependencies=yes=1|no=0
            

            6,685587
            Grand MasterGrand Master
            6,685587

              Mar 25, 2019#6

              For the user tool I suggest to configure %p (always without double quotes) for Working directory and use C:\go\bin\go.exe build "%n%e" && echo Done! for Command line. So the working directory is already set by UEStudio to directory of active file on starting the user tool and passed to go.exe is long file name + file extension of the active file. I am quite sure that go.exe is not anymore a 16-bit DOS application supporting only short file names in 8.3 format.

              The application configuration looks quite okay for me with still knowing nothing about golang. I would change in section [Environment] the entry PATH to: PATH = $(CPATH);%PATH%

              And I would modify in section [General] the entry DebugOut to: DebugOut = Debug The debug configuration is most likely never used, but it is better to have defined one.

              More help by me on application configuration is not possible for me at the moment without having studied documentation of golang.
              Best regards from an UC/UE/UES for Windows user from Austria