Dynamic workspace management method, device and equipment for Go language development

By introducing dynamic workspace management components into the Go language development environment, automatically managing and updating microservice dependency information, the high labor costs and inefficiency problems caused by frequent debugging in multi-module development are solved, and more efficient development environment management and operation are achieved.

CN119902746BActive Publication Date: 2025-06-06SUZHOU DAJIAYING INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510377087.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-06-06
Estimated Expiration
2045-03-28

AI Technical Summary

Technical Problem

In the Go language development environment, when multi-module development, it frequently switches multiple microservices in the project for debugging, which requires a lot of manual operations, resulting in high labor costs, long development time and prone to human errors, reducing development efficiency.

Method used

A dynamic workspace management method is provided. When identifying control instructions entered by a user, the dynamic workspace management component is pre-installed, and the dependency information required for the target code is automatically obtained and updated, and the information is recorded in the current workspace, so that the target code can be executed without manual configuration by the user.

Benefits of technology

It significantly improves the management efficiency and operation convenience of dynamic workspaces in the Go language development environment, greatly reduces the occurrence of human errors, and improves the development efficiency in multi-module development scenarios based on Go language.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119902746B_ABST
    Figure CN119902746B_ABST
Patent Text Reader

Abstract

The present invention discloses a dynamic workspace management method, device and equipment for Go language development. The method is executed by a dynamic workspace management component pre-installed in a Go language development environment, and the specific method includes: responding to a control instruction input by a user in real time in the Go language development environment, identifying whether the control instruction belongs to a dynamic workspace management instruction; if so, obtaining the instruction type of the control instruction according to the instruction code contained in the control instruction; when determining that the instruction type of the control instruction is an execution instruction for a target code, obtaining the target module information of the working module to which the target code belongs, and updating the target module information and writing it into the current workspace; after completing the update writing, executing the target code according to the various dependency information recorded in the current workspace. The technical solution of the embodiment of the present invention can significantly improve the management efficiency and operation convenience of the dynamic workspace in the Go language development environment, and greatly reduce human errors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer software technology, and in particular to a dynamic workspace management method, device and equipment for Go language development. Background Art

[0002] In the Go 1.18 version released for the Go language development tool, a new workspace mode is added to solve the dependency problem when developing multiple modules in a project. The workspace mode requires creating a go.work file in the project to write the dependency information required by each module, so as to avoid the rigid implementation method of placing all module codes in the same directory before Go 1.18.

[0003] Generally speaking, a project contains a large number of modules (also called microservices). Before debugging each microservice in the project locally, you need to initialize the dependency information required by the microservice in the project's go.work file. After that, the dependency information required by the microservice will be correctly configured, and then the correct running environment of the microservice can be ensured.

[0004] In the process of implementing the present invention, the inventors found that although the introduction of the workspace mode can greatly reduce the management complexity of dependent information during multi-module development, in the specific scenario where multiple microservices in a project need to be frequently switched and debugged separately, a large amount of manual operations need to be introduced, which not only brings excessive manpower cost consumption and increases development time, but also may introduce many human errors and reduce development efficiency. Summary of the invention

[0005] The embodiments of the present invention provide a dynamic workspace management method, device and equipment for Go language development, so as to significantly improve the management efficiency and operational convenience of the dynamic workspace in the Go language development environment, and greatly reduce the occurrence of human errors.

[0006] According to one aspect of an embodiment of the present invention, a dynamic workspace management method for Go language development is provided, which is executed by a dynamic workspace management component pre-installed in a Go language development environment, and includes:

[0007] In response to a control instruction input in real time by a user in a Go language development environment, identifying whether the control instruction belongs to a dynamic workspace management instruction;

[0008] If yes, obtaining the instruction type of the control instruction according to the instruction code contained in the control instruction;

[0009] When it is determined that the instruction type of the control instruction is an execution instruction for the target code, the target module information of the working module to which the target code belongs is obtained, and the target module information is updated and written into the current working area;

[0010] After the update writing is completed, the target code is executed according to the various dependency information recorded in the current workspace.

[0011] According to another aspect of an embodiment of the present invention, a dynamic workspace management device for Go language development is provided, which is configured in a dynamic workspace management component pre-installed in a Go language development environment, and includes:

[0012] An instruction recognition module, for responding to a control instruction input by a user in real time in a Go language development environment, and identifying whether the control instruction belongs to a dynamic workspace management instruction;

[0013] An instruction type acquisition module, for acquiring the instruction type of the control instruction according to the instruction code contained in the control instruction if it is identified that the control instruction belongs to the dynamic workspace management instruction;

[0014] A dependency information updating module, for obtaining target module information of a working module to which the target code belongs when determining that the instruction type of the control instruction is an execution instruction for the target code, and updating and writing the target module information into the current working area;

[0015] The code execution module is used to execute the target code according to various dependency information recorded in the current workspace after completing the update writing.

[0016] According to another aspect of an embodiment of the present invention, an electronic device is provided, the electronic device comprising:

[0017] at least one processor; and

[0018] a memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the dynamic workspace management method for Go language development described in any embodiment of the present invention.

[0020] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the dynamic workspace management method for Go language development described in any embodiment of the present invention when executed.

[0021] According to another aspect of an embodiment of the present invention, a computer program product is also provided, including a computer program, which, when executed by a processor, implements the steps of the dynamic workspace management method for Go language development as described in any embodiment of the present invention.

[0022] The technical solution of the embodiment of the present invention pre-builds a dynamic workspace management component and installs it in the Go language development environment. Through the dynamic workspace management component, when it is identified that the control instruction input by the user in the Go language development environment in real time belongs to the dynamic workspace management instruction, the instruction type of the control instruction can be obtained according to the instruction code contained in the control instruction; when it is determined that the instruction type of the control instruction is an execution instruction for the target code, the target module information of the working module to which the target code belongs is obtained, and the target module information is updated and written into the current workspace; after the update is completed, the target code is executed according to the various dependency information recorded in the current workspace. The above implementation method can automatically record the various dependency information required for the execution of the function code in the current workspace before the user debugs the function code belonging to a specific module, without the user having to perform any manual configuration, which can significantly improve the management efficiency and convenience of the dynamic workspace in the Go language development environment, greatly reduce the occurrence of human errors, and effectively improve the development efficiency in the multi-module development scenario based on the Go language.

[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0025] Figure 1 is a flow chart of a dynamic workspace management method for Go language development provided according to an embodiment of the present invention;

[0026] Figure 2 is a flowchart of another dynamic workspace management method for Go language development provided according to an embodiment of the invention;

[0027] Figure 3 This is a flowchart of a workspace switching operation applicable to an embodiment of the present invention;

[0028] Figure 4It is a flowchart of an implementation of operations performed in a project initialization phase applicable to an embodiment of the present invention;

[0029] Figure 5 It is a structural schematic diagram of a dynamic workspace management device for Go language development provided according to an embodiment of the present invention;

[0030] Figure 6 It is a structural schematic diagram of an electronic device that implements the dynamic workspace management method for Go language development according to an embodiment of the present invention. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0033] Figure 1 A flow chart of a dynamic workspace management method for Go language development provided by an embodiment of the present invention, this embodiment can be applied to the situation where, in the process of software development based on the Go language, before triggering the setting code in a module in the execution project, the various dependency information required by the module is automatically written to the current workspace of the project. The method can be executed by a dynamic workspace management device for Go language development, which can be implemented in the form of hardware and / or software, and can generally be used as an independent dynamic workspace management component, configured in a terminal device with a Go language development environment installed. For example, a desktop computer, a laptop computer, or a smart tablet.

[0034] Correspondingly, such as Figure 1 As shown, the method may include:

[0035] S110 . In response to a control instruction input by a user in real time in a Go language development environment, identifying whether the control instruction belongs to a dynamic workspace management instruction.

[0036] In this embodiment, the developer (ie, the user) can install the Go language development environment in the terminal device used by him / her, and install the dynamic workspace management component provided by the embodiment of the present invention in the Go language development environment. Specifically, the dynamic workspace management component can be understood as a plug-in for providing a dynamic workspace management function. For example, the dynamic workspace management component can be installed through "go get".

[0037] After completing the installation of the above dynamic workspace management component, the developer can implement project development based on the Go language development environment. Specifically, the user can input various control instructions in real time in the human-computer interaction interface provided by the Go language development environment to complete the corresponding software development functions.

[0038] In an optional implementation of the present embodiment, the dynamic workspace management component may first obtain a control instruction input by the user, and identify through preset rules (such as regular expressions) whether the control instruction is an instruction that the dynamic workspace management component can process, that is, a dynamic workspace management instruction.

[0039] In a specific example, if the key identifier included in the control instruction is "go", it is determined that the control instruction does not belong to the dynamic workspace management instruction; if the key identifier included in the control instruction is "gow", it is determined that the control instruction belongs to the dynamic workspace management instruction.

[0040] Of course, it is understandable that new instructions that are different from the existing general instruction library in the Go language development environment in format or key identifiers can be constructed as dynamic workspace management instructions. This embodiment does not limit the specific format of the dynamic workspace management instructions.

[0041] S120: If yes, obtain the instruction type of the control instruction according to the instruction code included in the control instruction.

[0042] If it is determined that the control instruction input by the user belongs to a dynamic workspace management instruction, the control instruction needs to be executed according to the processing logic specified in the dynamic workspace management component. Specifically, the control instruction can be firstly parsed to obtain the instruction code contained in the control instruction, and the instruction type of the control instruction can be obtained according to the specific form of the instruction code.

[0043] In an optional implementation of this embodiment, if the instruction format of the control instruction is: "gow runXXX", the instruction code contained in the control instruction can be obtained as "run" through instruction parsing, and then the instruction type can be determined as: an execution instruction for the target code "XXX".

[0044] S130. When it is determined that the instruction type of the control instruction is an execution instruction for the target code, the target module information of the working module to which the target code belongs is obtained, and the target module information is updated and written into the current working area.

[0045] The target module information may be all dependency information required by the working module, or information of storage addresses of all dependency information required by the working module.

[0046] In this embodiment, when a developer enters an execution instruction for a target code in the Go language development environment, it indicates that the developer has entered a development project and is developing and modulating related codes in a microservice or multiple microservices in the development project. The microservice may also be referred to as a working module.

[0047] The above development and debugging process may generally correspond to two situations: Scenario 1 is that the developer first completes the running debugging of the sub-function sub1 in the working module A, and currently wants to continue running and debugging the sub-function sub2 in the working module A; Scenario 2 is that the developer first completes the running debugging of the sub-function sub1 in the working module A, and currently wants to continue running and debugging the sub-function sub3 in the working module B.

[0048] It is understandable that, for scenario 1, since the dependency information (or dependency relationship) required for the execution of sub2 and sub1 is managed by the go.mod file corresponding to the working module A, and after sub1 is correctly executed, it means that the go.mod file corresponding to the working module A has been pre-introduced into the current workspace, so the control instruction of the form "gow run sub2" can be directly executed. However, for scenario 2, since the dependency information required for the execution of sub3 is managed by the go.mod file corresponding to the working module B, and the above file is not pre-introduced into the current workspace when executing sub1, if the control instruction of the form "gow run sub3" is directly executed, there is a high probability that an execution exception will occur due to the lack of necessary dependency information.

[0049] In the prior art, in order to avoid the above situation, developers need to manually switch the dependency information stored in the current workspace from the dependency information of work module A to the dependency information of work module B. This implementation method will bring a lot of extra workload to developers, making it impossible for them to focus on the development and debugging of the work module itself. In addition, if the developer forgets to perform the above dependency information switching operation, it will also bring unnecessary exception troubleshooting operations.

[0050] In view of this, various embodiments of the present invention propose a new dynamic workspace management method, where developers only need to focus on code development and debugging, and the switching operation of dependent information is automatically detected and completed by the dynamic workspace management component.

[0051] Accordingly, in an optional implementation of this embodiment, obtaining the target module information of the working module to which the target code belongs, and updating and writing the target module information into the current working area may include:

[0052] Starting from the directory where the target code is located, search for the go.mod file layer by layer upwards;

[0053] When the go.mod file is found, the target address of the go.mod file is obtained;

[0054] Query the environment variable storage file that matches the current workspace, obtain the address of the global working directory, and locate the go.work file in the global working directory according to the address of the global working directory;

[0055] In the located go.work file, update the target address where the go.mod file is located to add the dependency information defined in the go.mod file to the current workspace.

[0056] When developers develop different microservices or work modules, they will place all code files involved in the microservice in the microservice directory that matches the microservice. At the same time, in the microservice directory, there is a go.mod file that matches the microservice, which is used to store all dependency information required by the microservice, that is, all information about the microservice's dependence on third parties. Generally speaking, the go.mod file is stored in the first-level subdirectory of the microservice.

[0057] In combination with the above technical background, it can be known that when the developer inputs the execution instruction of the target code in the Go language development environment, the identification information of the target code can be first identified in the instruction, and based on the identification information, the directory location where the target code is located can be located. Afterwards, starting from the directory location where the target code is located, the go.mod file is first searched in the same-level directory, and if it is found, it stops, and if it is not found, it continues to search in the upper-level directory until the go.mod file is finally found. It can be understood that the first go.mod file found first with the directory location where the target code is located as the starting point is the go.mod file corresponding to the microservice to which the target code belongs. Further, after finding the go.mod file, the target address where the go.mod file is located can be obtained synchronously, for example, the relative path of the go.mod file under the microservice directory of the microservice to which the target code belongs.

[0058] After obtaining the target address of the go.mod file, as long as the target address is written into the go.work file under the project to which the microservice belongs, it means that the target module information of the working module to which the target code belongs has been successfully written into the current workspace. At this time, when executing the target code again, all the dependency information recorded in the go.mod file can be obtained based on the target address recorded in the current workspace, and based on the above dependency information, the target code can be executed correctly.

[0059] Specifically, when developers develop one or more microservices (or work modules) for the same project, they will first build a global working directory for the project. In this embodiment, in order to quickly locate the global working directory, the inventor proposes to write the address of the global working directory into the environment variable storage file corresponding to the project. Among them, the environment variable storage file is mainly used to store various environment variables required in the project development process, such as Go workspace path, Go language installation path, executable file storage directory, database link information, key information, and port number. In general, a project corresponds to only one environment variable storage file. By storing the address of the global working directory in the environment variable storage file, it can assist in quickly determining the specific location of the go.work file in the project.

[0060] In a specific example, a project corresponds to a go.work file, and the go.work file is generally stored in the first-level directory of the project's global working directory. Through the go.work file, the storage address of various dependency information required when the current workspace executes the code can be stored, that is, the storage address of the go.mod file of the working module to which the code to be executed belongs.

[0061] Through the above settings, before an execution instruction for the target code is executed, the dynamic workspace management component can first automatically obtain the storage address of the dependency information required for the execution of the target code, and then automatically write the obtained storage address into the current workspace of the project to which the target code belongs to complete the conversion of the dependency relationship.

[0062] In another optional implementation of this embodiment, if it is found through the detection of the execution status of each historical control instruction that before the execution instruction of the target code 1 is detected, the most recently executed historical control instruction is the execution instruction of the target code 2, and the execution result of the historical control instruction is successful execution, at this time, it can be first detected whether the target code 2 and the target code 1 belong to the same microservice. If so, the execution instruction of the target code 1 can be directly executed, and if not, the aforementioned switching operation of the dependency information is performed.

[0063] Through the above settings, you can use the automated verification mechanism to effectively avoid operations in invalid directories or wrong contexts, reducing the time for debugging and error correction.

[0064] S140. After completing the update writing, execute the target code according to various dependency information recorded in the current workspace.

[0065] As mentioned above, after the storage address of the go.mod file of the working module to which the target code belongs is updated and written to the go.work file of the project to which the working module belongs, the target code can be executed normally.

[0066] The technical solution of the embodiment of the present invention pre-builds a dynamic workspace management component and installs it in the Go language development environment. Through the dynamic workspace management component, when it is identified that the control instruction input by the user in the Go language development environment in real time belongs to the dynamic workspace management instruction, the instruction type of the control instruction can be obtained according to the instruction code contained in the control instruction; when it is determined that the instruction type of the control instruction is an execution instruction for the target code, the target module information of the working module to which the target code belongs is obtained, and the target module information is updated and written into the current workspace; after the update and writing is completed, the target code is executed according to the various dependency information recorded in the current workspace. The above implementation method can automatically record the various dependency information required for the execution of the function code in the current workspace before the user modulates the function code belonging to a specific module, without the user having to perform any manual configuration, which can significantly improve the management efficiency and convenience of the dynamic workspace in the Go language development environment, greatly reduce the occurrence of human errors, and effectively improve the development efficiency in the multi-module development scenario based on the Go language.

[0067] On the basis of the above embodiments, after identifying whether the control instruction belongs to the dynamic workspace management instruction, the following steps may also be included:

[0068] If not, a general instruction library pre-configured in the Go language development environment is called to obtain instruction processing logic matching the control instruction, and execute the instruction processing logic.

[0069] In this optional implementation, by adding a dynamic workspace management component in the Go language development environment, the dynamic workspace management component can first screen the input control instructions, obtain the dynamic workspace management instructions that the dynamic workspace management component can process, and process them. For those instructions that the dynamic workspace management component cannot process, the corresponding control instructions are executed according to the instruction processing logic defined in the general instruction library pre-configured in the Go language development environment.

[0070] The above settings are equivalent to expanding the management function of dynamic workspaces without affecting the existing functions of the Go language development environment. On the basis of introducing the minimum learning cost (it is necessary to know in advance how to build various dynamic workspace management instructions), the manual configuration workload in multi-module development scenarios is greatly reduced.

[0071] It should be noted that, whether the control instruction is executed based on the dynamic workspace management component or based on the general instruction library, the general processing execution logic of the control instruction is: obtain the control instruction input by the developer -> parse the type of the control instruction -> create an instance (object) of the control instruction -> execute the processing logic of the control instruction (typically, call the 'Execute' method implemented by the control instruction). In addition, when the developer enters an unknown control instruction, it will generally trigger a prompt help message or return an error.

[0072] In another optional implementation of this embodiment, the Go language development environment can also be used to dynamically create instances of various control commands, and the extensibility of different command behaviors can be achieved through interface polymorphism to further expand the functions of the dynamic workspace management component. For example, version update instructions can be added to the dynamic workspace management component.

[0073] On the basis of the above embodiments, after obtaining the instruction type of the control instruction according to the instruction code included in the control instruction, the following may also be included:

[0074] When it is determined that the instruction type of the control instruction is a workspace reset instruction, the environment variable storage file matching the current workspace is queried to obtain the address of the global working directory, and the go.work file and the go.work.sum file in the global working directory are located according to the address of the global working directory;

[0075] Delete the located go.work file and go.work.sum file to reset the current workspace.

[0076] Generally speaking, a go.work.sum file is stored in the global working directory of a project. Typically, the go.work.sum file is also stored in the first-level directory of the global working directory. The go.work.sum is mainly used to store the hash values ​​of all directly or indirectly dependent modules. In the prior art, when a developer needs to reset the current workspace of a project as a whole, he needs to manually locate the first-level directory of the global working directory and manually delete the go.work file and go.work.sum file in the first-level directory.

[0077] In this optional implementation, the inventor has considered adding a dynamic workspace management function, and further, considered constructing a workspace reset instruction such as "gow reset" to automatically reinitialize the workspace files to ensure a clean and consistent development environment. Through the above settings, the consistency of the workspace can be quickly restored to avoid environmental problems caused by manual file deletion or configuration errors.

[0078] Figure 2 The present invention provides another flow chart of a dynamic workspace management method for Go language development. This embodiment is refined based on the above embodiments. In this embodiment, it is specifically clarified that when the instruction type of the control instruction is determined to be a workspace switching instruction, the specific processing flow executed by the dynamic workspace management component is clarified. Figure 2 As shown, the method includes:

[0079] S210. In response to a control instruction input by a user in real time in a Go language development environment, identifying whether the control instruction belongs to a dynamic workspace management instruction.

[0080] S220: If yes, obtain the instruction type of the control instruction according to the instruction code included in the control instruction.

[0081] S230: When it is determined that the instruction type of the control instruction is a workspace switching instruction, obtain an environment variable included in the workspace switching instruction as a target switching path.

[0082] In this embodiment, the workspace switching instruction is used to switch from a currently developed project to another project for continued development. Each project includes multiple microservices.

[0083] Specifically, a workspace switching instruction of the form "gow root YYY" can be constructed, and the environment variable "YYY" carried in the workspace switching instruction is used to indicate the directory location of the target project to be switched, that is, the target switching path.

[0084] S240: If it is determined that the target switching path exists, query the environment variable storage file that matches the current workspace to obtain the address of the global working directory.

[0085] As mentioned above, each project stores an environment variable storage file corresponding to one, and the address of the global working directory of the project is pre-stored in the environment variable storage file. Based on the address of the global working directory, the go.work file in the project can be obtained in the first-level directory of the global working directory.

[0086] It is understandable that when it is determined that the target switching path does not exist, an error prompt can be directly given to the developer through the human-computer interaction window, and the cause of the error can be given.

[0087] S250. According to the address of the global working directory, locate the go.work file in the global working directory.

[0088] S260. When the go.work file is located and obtained, a prompt message is popped up to the user asking whether to overwrite the file.

[0089] It is understandable that the go.work file currently located stores the dependency information corresponding to the current workspace of the current development project. If you need to switch projects or workspaces, you need to delete the go.work file first. However, in order to prevent users from mistakenly entering the workspace switching command, a prompt message can be popped up first to ask whether to overwrite, so that users can confirm it again, minimizing the probability of misoperation.

[0090] It is understandable that if the go.work file is not located, an error prompt can be directly given to the developer through the human-computer interaction window, and the cause of the error can be given.

[0091] Through the above human-computer interaction method, users can be provided with clear operation guidance, reducing the risk of misoperation. In addition, the error prompt information is intuitive and easy to understand, helping users to quickly locate the problem and improve learning efficiency.

[0092] S270: In response to the user's confirmation overwrite response to the prompt information feedback, delete the located go.work file.

[0093] S280: Determine the target switching path (also referred to as GOW_ROOT) as the root path corresponding to the new current workspace, and write the target switching path into an environment variable storage file matching the new current workspace.

[0094] Among them, by using the dynamically set GOW_ROOT environment variable, persistent configuration across sessions can be achieved.

[0095] After deleting the go.work file in the old project before the switch, the current file path needs to be pointed to the target switch path, that is, the address of the global working directory of the new project after the switch. After that, the target switch path needs to be written to the environment variable storage file corresponding to the new project for persistence.

[0096] S290. When it is detected that no go.work file is stored in the new current workspace, a new go.work file matching the new current workspace is created.

[0097] In this embodiment, after the workspace is switched, the new workspace may be first checked to see if there is a go.work file for storing various dependency information in the new workspace. If not, a new go.work file may be automatically constructed for the developer to input various dependency information required by each microservice in the project.

[0098] Of course, it is understandable that the new go.work file may also be created independently by the developer, and this embodiment does not limit this.

[0099] In a specific example, Figure 3 FIG. 1 is a flowchart of a workspace switching operation applicable to an embodiment of the present invention. Figure 3 As shown, the above workspace switching operation may specifically include: inputting a root command (that is, a workspace switching instruction) -> checking the existence of the path contained in the root command -> if it exists, asking the user whether to confirm overwriting the workspace -> if so, after deleting the go.work file in the original workspace, updating the .env file (environment variable storage file) in the new workspace -> setting the path contained in the root command as the root path of the new workspace.

[0100] The technical solution of the embodiment of the present invention is to obtain the environment variables contained in the workspace switching instruction as the target switching path when determining that the instruction type of the control instruction is a workspace switching instruction; if it is determined that the target switching path exists, query the environment variable storage file matching the current workspace, obtain the address of the global working directory, and locate the go.work file under the global working directory according to the address of the global working directory; when the go.work file is located and obtained, a prompt message pops up to the user whether to overwrite; in response to the user's confirmation overwrite response feedback to the prompt information, the located go.work file is deleted; the target switching path is determined as the root path corresponding to the new current workspace, and the target switching path is written into the environment variable storage file matching the new current workspace. When the developer has a workspace switching demand, the workspace switching operation can be automatically implemented to minimize the manual operation workload of the developer and further improve the software development efficiency based on the Go language.

[0101] Based on the above embodiments, the method may further include:

[0102] When executing the project initialization operation, a setting window for the global working directory path and environment variable file path will pop up to the user;

[0103] In response to a directory address input by a user in the setting window, initializing a directory matching the directory address as a global working directory of the current workspace;

[0104] In response to a file path input by a user in the setting window, detecting whether a target file exists under the file path;

[0105] If yes, after determining the target file as an environment variable file matching the current workspace, read and load the environment variable file to dynamically respond to various control instructions input by the user;

[0106] If not, a default environment variable file is created, and after the directory address of the global working directory is written into the created environment variable file, the environment variable file is read and loaded to dynamically respond to various control instructions input by the user.

[0107] In this optional implementation, in order to further simplify the manual workload of developers, the manual workload of developers can be reduced to the greatest extent during the initialization phase of a project. Figure 4 A flowchart of the implementation of operations performed in the project initialization phase applicable to an embodiment of the present invention is shown in FIG.

[0108] like Figure 4As shown, after the program is started, the dynamic workspace management component first obtains the storage address (i.e., directory address) of the global working directory input by the user and the storage path (i.e., file path) of the environment variable file (.env file) through human-computer interaction. Then, after detecting and determining that the target address exists, the global working directory of the project is automatically initialized and set according to the target address.

[0109] Furthermore, it is detected whether the .env file exists in the file path where the environment variable file is located. If it does not exist, the environment variable file is automatically constructed according to a preset environment variable file construction template and stored in the file path.

[0110] Finally, after writing the directory address of the global working directory into the created environment variable file, the environment variable file is read and loaded into the memory to dynamically respond to various control instructions input by the user.

[0111] In this embodiment, the various environment variables in the .env file can be directly loaded into the memory to avoid manual settings and repeated modifications. Through the above settings, the steps of manually configuring the working path and environment variables are reduced, and the initial configuration time is greatly reduced; compile or run failures caused by path configuration errors are avoided, and development efficiency is improved. In addition, by automatically generating the default structure of the .env file, intuitive guidance can be provided for first-time users.

[0112] Furthermore, in each embodiment of the present invention, it is supported to update the variable values ​​in the .env file in real time and dynamically take effect. At the same time, it supports automatic appending of new variables to avoid file overwriting or repeated settings. Through the above settings, users can flexibly adjust environment variables according to their needs without restarting the Go language development tool, which enhances the adaptability of the development environment. In addition, through automatic persistence settings, the problem of repeated configuration caused by the loss of temporary variables is eliminated.

[0113] It is important to emphasize again that the dynamic workspace management component developed in each embodiment of the present invention incorporates user interaction and error handling mechanisms. In terms of user interaction design, standard input and output are used to interact with the user (such as overwrite confirmation); in terms of error handling mechanisms, each key step has an error capture mechanism to ensure program stability.

[0114] If the dynamic workspace management component is divided based on the implementation function, the dynamic workspace management component can be divided into a command processing module, an environment variable management module, a user interaction module, and a Go file verification module.

[0115] Among them, the command processing module is used to parse command line parameters and assign them to specific functional modules; the environment variable management module is responsible for creating, updating and loading .env files; the user interaction module is used to implement interaction logic with users, such as confirmation prompts, error message output, etc.; the file verification module is used to ensure the validity of the current working directory.

[0116] In addition, the technical solutions of the embodiments of the present invention are also designed for extensibility. Specifically, by using interfaces and factory mode to manage commands, it is convenient to add new command types later. In addition, it also provides the ability to dynamically load environment variables to support user-defined configuration.

[0117] Based on this, the embodiments of the present invention focus on multi-module management, automatic processing of environment variables and user-friendly interaction mechanism in the software development environment, and solve the problems of configuration complexity, low efficiency and lack of flexibility in traditional methods. Specifically, the following beneficial effects can be achieved:

[0118] 1. Intelligent management mechanism of multi-module development environment

[0119] Based on the multi-module workspace of go work, an intelligent root path management system is designed to achieve the following functions:

[0120] 1) Dynamic identification and configuration of root paths: Automatically check and set the working directory and store it in the form of environment variables, eliminating the complexity of manual configuration.

[0121] 2) Workspace consistency maintenance: Provides a workspace reset command (for example, reset) to clean up and reinitialize the go.work file with one click, ensuring the consistency and standardization of the multi-module development environment.

[0122] The above functions can realize dynamic management of multi-module development directories, adapt to the development needs of different teams or individuals, as well as automatic path configuration and environment persistence, reducing human errors.

[0123] 2. Automatic loading and persistence of environment variable files

[0124] The embodiments of the present invention design a dynamic loading and updating mechanism for environment variables based on .env files, which solves the following pain points of variable management in the development environment:

[0125] 1) Automatic generation and update: When the system starts, it automatically checks the existence of the .env file, automatically generates a default file, and updates it in real time based on user operations.

[0126] 2) Persistence of variables across sessions: User-defined variables are stored in the .env file, ensuring that the configuration is retained seamlessly even when the application is restarted.

[0127] The above functions can simplify the complex environment variable management process into automated operations, greatly improving development efficiency. At the same time, it supports user-defined variables and enhances the flexibility and adaptability of the system.

[0128] 3. Command dynamic scheduling and expansion mechanism

[0129] The factory mode is used to implement command parsing and dynamic dispatch, solving the problem of insufficient scalability of traditional command line tools:

[0130] 1) Dynamically create command instances: The system can dynamically load command objects based on user input and call the corresponding logic handlers.

[0131] 2) Modular design: All commands implement interface polymorphism, making it easy to add new functions later.

[0132] The above functions can achieve high scalability of command design, facilitate long-term maintenance and function expansion, and reduce redundant code through dynamic dispatch, thus improving the system's code reuse rate.

[0133] 4. Two-way verification mechanism between working directory and Go module

[0134] In the program running command (such as run), automatic verification of the working directory and Go module files is implemented:

[0135] 1) Current directory verification: Check whether the current path contains a valid go.mod file to ensure that the user is always operating in a legitimate Go project.

[0136] 2) File detection and prompts: By detecting source code files, the system automatically determines the running context and guides user operations.

[0137] The above functions can ensure the legitimacy of operations and avoid running invalid commands. At the same time, the automated verification mechanism improves the development experience.

[0138] 5. User-friendly interaction and error handling mechanism

[0139] Introduced a user-friendly prompt mechanism and comprehensive error capture design:

[0140] 1) Interaction mechanism: Provide clear prompts in key operations (such as path coverage and variable update) to guide user decision-making.

[0141] 2) Error capture: A complete error handling logic is designed for each operation step to prevent system crashes.

[0142] The above functions improve the usability and robustness of the software and reduce the learning cost. In addition, the clear design of error messages helps to quickly locate and solve problems.

[0143] In summary, the dynamic workspace management component constructed by each embodiment of the present invention can achieve:

[0144] 1. Intelligent multi-module workspace management mechanism, dynamic configuration of root path, and automatic maintenance of workspace consistency.

[0145] 2. Automatic loading, persistent storage, and cross-session sharing of environment variables.

[0146] 3. The dynamic scheduling and extension design of commands based on the factory mode improves the flexibility of command line tools.

[0147] 4. Automatic verification mechanism of working directory and Go module to ensure the legitimacy and validity of operations.

[0148] 5. User-friendly interactive prompts and comprehensive error capture improve the stability and ease of use of the software.

[0149] These technical points jointly solve the problems of complex development environment configuration and inefficient multi-module management, significantly optimize the experience and efficiency of software development, and have important innovation and practical value. Through the above technical solutions, the present invention significantly improves the management efficiency and operational convenience of the development environment, reduces human errors, and enhances the scalability and stability of the system. Combined with automated verification, environment variable management and user-friendly design, the present invention is suitable for multi-module development scenarios and can be widely used in the actual development of Go programming.

[0150] Figure 5 The present invention provides a structural diagram of a dynamic workspace management device for Go language development provided by an embodiment of the present invention. The device is configured in a dynamic workspace management component pre-installed in a Go language development environment. Figure 5 As shown, the device may include: an instruction identification module 510, an instruction type acquisition module 520, a dependency information update module 530 and a code execution module 540, wherein:

[0151] An instruction recognition module 510, for responding to a control instruction input by a user in real time in a Go language development environment, and identifying whether the control instruction belongs to a dynamic workspace management instruction;

[0152] The instruction type acquisition module 520 is used to acquire the instruction type of the control instruction according to the instruction code contained in the control instruction if the control instruction is identified as a dynamic workspace management instruction;

[0153] The dependency information updating module 530 is used to obtain the target module information of the working module to which the target code belongs when determining that the instruction type of the control instruction is an execution instruction for the target code, and update and write the target module information into the current working area;

[0154] The code execution module 540 is used to execute the target code according to various dependency information recorded in the current workspace after completing the update writing.

[0155] The technical solution of the embodiment of the present invention pre-builds a dynamic workspace management component and installs it in the Go language development environment. Through the dynamic workspace management component, when it is identified that the control instruction input by the user in the Go language development environment in real time belongs to the dynamic workspace management instruction, the instruction type of the control instruction can be obtained according to the instruction code contained in the control instruction; when it is determined that the instruction type of the control instruction is an execution instruction for the target code, the target module information of the working module to which the target code belongs is obtained, and the target module information is updated and written into the current workspace; after the update and writing is completed, the target code is executed according to the various dependency information recorded in the current workspace. The above implementation method can automatically record the various dependency information required for the execution of the function code in the current workspace before the user modulates the function code belonging to a specific module, without the user having to perform any manual configuration, which can significantly improve the management efficiency and convenience of the dynamic workspace in the Go language development environment, greatly reduce the occurrence of human errors, and effectively improve the development efficiency in the multi-module development scenario based on the Go language.

[0156] Based on the above embodiments, the dependency information updating module 530 can be specifically used for:

[0157] Starting from the directory where the target code is located, search for the go.mod file layer by layer upwards;

[0158] When the go.mod file is found, the target address of the go.mod file is obtained;

[0159] Query the environment variable storage file that matches the current workspace, obtain the address of the global working directory, and locate the go.work file in the global working directory according to the address of the global working directory;

[0160] In the located go.work file, update the target address where the go.mod file is located to add the dependency information defined in the go.mod file to the current workspace.

[0161] Based on the above embodiments, the device may further include a workspace switching module, which is used to:

[0162] After obtaining the instruction type of the control instruction according to the instruction code included in the control instruction, when it is determined that the instruction type of the control instruction is a workspace switching instruction, obtaining the environment variable included in the workspace switching instruction as a target switching path;

[0163] If it is determined that the target switching path exists, query the environment variable storage file matching the current workspace, obtain the address of the global working directory, and locate the go.work file in the global working directory according to the address of the global working directory;

[0164] When the go.work file is located and obtained, a prompt message is popped up to the user asking whether to overwrite it;

[0165] In response to a confirmation overwrite response from the user to the prompt information, deleting the located go.work file;

[0166] Determine the target switching path as a root path corresponding to the new current workspace, and write the target switching path into an environment variable storage file matching the new current workspace;

[0167] When it is detected that no go.work file is stored in the new current workspace, a new go.work file matching the new current workspace is created.

[0168] Based on the above embodiments, a workspace resetting module may be further included, which is used to:

[0169] After obtaining the instruction type of the control instruction according to the instruction code contained in the control instruction, when it is determined that the instruction type of the control instruction is a workspace reset instruction, query the environment variable storage file matching the current workspace, obtain the address of the global working directory, and locate the go.work file and go.work.sum file in the global working directory according to the address of the global working directory;

[0170] Delete the located go.work file and go.work.sum file to reset the current workspace.

[0171] Based on the above embodiments, an initialization module may be further included, which is used to:

[0172] When executing the project initialization operation, a setting window for the global working directory path and environment variable file path will pop up to the user;

[0173] In response to a directory address input by a user in the setting window, initializing a directory matching the directory address as a global working directory of the current workspace;

[0174] In response to a file path input by a user in the setting window, detecting whether a target file exists under the file path;

[0175] If yes, after determining the target file as an environment variable file matching the current workspace, read and load the environment variable file to dynamically respond to various control instructions input by the user;

[0176] If not, a default environment variable file is created, and after the directory address of the global working directory is written into the created environment variable file, the environment variable file is read and loaded to dynamically respond to various control instructions input by the user.

[0177] On the basis of the above embodiments, a general instruction execution module may also be included, which is used to:

[0178] After identifying whether the control instruction belongs to a dynamic workspace management instruction, if not, a general instruction library pre-configured in the Go language development environment is called to obtain instruction processing logic matching the control instruction, and execute the instruction processing logic.

[0179] The dynamic workspace management device for Go language development provided by the embodiment of the present invention can execute the dynamic workspace management method for Go language development provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0180] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0181] Figure 6 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0182] like Figure 6As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.

[0183] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0184] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as executing the dynamic workspace management method for Go language development as described in any embodiment of the present invention.

[0185] In some embodiments, the dynamic workspace management method for Go language development as described in any embodiment of the present invention may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the dynamic workspace management method for Go language development as described in any embodiment of the present invention described above may be executed. Alternatively, in other embodiments, the processor 11 may be configured in any other appropriate manner (for example, by means of firmware) to execute the dynamic workspace management method for Go language development as described in any embodiment of the present invention, which is executed by a dynamic workspace management component pre-installed in the Go language development environment. That is:

[0186] In response to a control instruction input in real time by a user in a Go language development environment, identifying whether the control instruction belongs to a dynamic workspace management instruction;

[0187] If yes, obtaining the instruction type of the control instruction according to the instruction code contained in the control instruction;

[0188] When it is determined that the instruction type of the control instruction is an execution instruction for the target code, the target module information of the working module to which the target code belongs is obtained, and the target module information is updated and written into the current working area;

[0189] After the update writing is completed, the target code is executed according to the various dependency information recorded in the current workspace.

[0190] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0191] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0192] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0193] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0194] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0195] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0196] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0197] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A dynamic workspace management method for Go language development, executed by a dynamic workspace management component pre-installed in a Go language development environment, characterized in that: include: In response to a control instruction input in real time by a user in a Go language development environment, identifying whether the control instruction belongs to a dynamic workspace management instruction; If yes, obtaining the instruction type of the control instruction according to the instruction code contained in the control instruction; When it is determined that the instruction type of the control instruction is an execution instruction for the target code, the target module information of the working module to which the target code belongs is obtained, and the target module information is updated and written into the current working area; After the update writing is completed, the target code is executed according to the various dependency information recorded in the current workspace.

2. The method according to claim 1, characterized in that Get the target module information of the working module to which the target code belongs, and update the target module information to the current workspace, including: Starting from the directory where the target code is located, search for the go.mod file layer by layer upwards; When the go.mod file is found, the target address of the go.mod file is obtained; Query the environment variable storage file that matches the current workspace, obtain the address of the global working directory, and locate the go.work file in the global working directory according to the address of the global working directory; In the located go.work file, update the target address where the go.mod file is located to add the dependency information defined in the go.mod file to the current workspace.

3. The method according to claim 1, characterized in that After obtaining the instruction type of the control instruction according to the instruction code contained in the control instruction, the following steps are also included: When it is determined that the instruction type of the control instruction is a workspace switching instruction, obtaining an environment variable contained in the workspace switching instruction as a target switching path; If it is determined that the target switching path exists, query the environment variable storage file matching the current workspace, obtain the address of the global working directory, and locate the go.work file in the global working directory according to the address of the global working directory; When the go.work file is located and obtained, a prompt message is popped up to the user asking whether to overwrite it; In response to a confirmation overwrite response from the user to the prompt information, deleting the located go.work file; Determine the target switching path as a root path corresponding to the new current workspace, and write the target switching path into an environment variable storage file matching the new current workspace; When it is detected that no go.work file is stored in the new current workspace, a new go.work file matching the new current workspace is created.

4. The method according to claim 1, characterized in that: After obtaining the instruction type of the control instruction according to the instruction code contained in the control instruction, the following steps are also included: When it is determined that the instruction type of the control instruction is a workspace reset instruction, the environment variable storage file matching the current workspace is queried to obtain the address of the global working directory, and the go.work file and the go.work.sum file in the global working directory are located according to the address of the global working directory; Delete the located go.work file and go.work.sum file to reset the current workspace.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: When executing the project initialization operation, a setting window for the global working directory path and environment variable file path will pop up to the user; In response to a directory address input by a user in the setting window, initializing a directory matching the directory address as a global working directory of the current workspace; In response to a file path input by a user in the setting window, detecting whether a target file exists under the file path; If yes, after determining the target file as an environment variable file matching the current workspace, read and load the environment variable file to dynamically respond to various control instructions input by the user; If not, a default environment variable file is created, and after the directory address of the global working directory is written into the created environment variable file, the environment variable file is read and loaded to dynamically respond to various control instructions input by the user.

6. The method according to any one of claims 1 to 4, characterized in that: After identifying whether the control instruction belongs to the dynamic workspace management instruction, it also includes: If not, a general instruction library pre-configured in the Go language development environment is called to obtain instruction processing logic matching the control instruction, and execute the instruction processing logic.

7. A dynamic workspace management device for Go language development, configured in a dynamic workspace management component pre-installed in a Go language development environment, characterized in that: include: An instruction recognition module, for responding to a control instruction input by a user in real time in a Go language development environment, and identifying whether the control instruction belongs to a dynamic workspace management instruction; An instruction type acquisition module, for acquiring the instruction type of the control instruction according to the instruction code contained in the control instruction if it is identified that the control instruction belongs to the dynamic workspace management instruction; A dependency information updating module, for obtaining target module information of a working module to which the target code belongs when determining that the instruction type of the control instruction is an execution instruction for the target code, and updating and writing the target module information into the current working area; The code execution module is used to execute the target code according to various dependency information recorded in the current workspace after completing the update writing.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the dynamic workspace management method for Go language development described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the dynamic workspace management method for Go language development according to any one of claims 1 to 6 when executed.

10. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the dynamic workspace management method for Go language development according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Unified management method and device for packet dependence management tool of Go language

    CN111736886A

  • Go project dependency package management method and device, equipment and storage medium

    CN116521218A